Commit 52b6d47
authored
Handle bounds in the CholeskyOp shape function (#887)
Cholesky op's [constraint
(C3)](https://github.com/openxla/stablehlo/blob/main/docs/spec.md#cholesky)
requires the last two dimensions to be the same. The bound rules are as
follows (3 being an arbitrary static shape):
```
dynamic type inference rules for the last two dims of A (case0 is sanity
check for dynamic batch dims):
dim R-2 | dim R-1 | inferred R-2 | inferred R-1
case0: 3 | 3 | 3 | 3
case1: ? | 3 | 3 | 3
case2: ? | ? | ? | ?
dynamic bound infererence rules for the last two dims of A (case0 is
sanity check for dynamic batch dims):
dim R-2 | dim R-1 | inferred R-2 | inferred R-1
case0: 3, ? | 3, ? | 3, ? | 3, ?
case1: ?, ? | 3, ? | 3, ? | 3, ?
case2: ?, A<3 | 3, ? | error | error
case3: ?, A>=3 | 3, ? | 3, ? | 3, ?
case4: ?, ? | ?, ? | ?, ? | ?, ?
case5: ?, A | ?, ? | ?, A | ?, A
case6: ?, A | ?, B | ?, min(A,B) | ?, min(A,B)
```
The rules proposed above are reviewed and agreed upon, but there will be
no immediate implementation in the current PR to follow recently updated
guidelines.
closes #8041 parent d2cc1fa commit 52b6d47
File tree
2 files changed
+15
-6
lines changed- stablehlo
- dialect
- tests
2 files changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1443 | 1443 | | |
1444 | 1444 | | |
1445 | 1445 | | |
| 1446 | + | |
1446 | 1447 | | |
1447 | | - | |
| 1448 | + | |
| 1449 | + | |
1448 | 1450 | | |
1449 | 1451 | | |
1450 | 1452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 91 | + | |
| 92 | + | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| |||
378 | 377 | | |
379 | 378 | | |
380 | 379 | | |
381 | | - | |
| 380 | + | |
382 | 381 | | |
383 | 382 | | |
384 | 383 | | |
| |||
1037 | 1036 | | |
1038 | 1037 | | |
1039 | 1038 | | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1040 | 1047 | | |
1041 | 1048 | | |
1042 | 1049 | | |
| |||
1165 | 1172 | | |
1166 | 1173 | | |
1167 | 1174 | | |
1168 | | - | |
| 1175 | + | |
1169 | 1176 | | |
1170 | 1177 | | |
1171 | 1178 | | |
| |||
0 commit comments