Commit 8f87f14
committed
[compiler][conversion] Fix an issue in
This PR fixes an issue in `stablehlo.slice` conversion which
popped result type is dynamic.
In the converter, we use `tensorrt.slice` op builder that
infers result based on `static_size` (output shape is same as size on
TensorRT side) and `size` was taken as shape of stablehlo op output.
This caused two issues,
- `truncateI64ToI32` failed for dynamic output because dynamic dim can't be
truncated to i32 without loss.
- A new builder needed which could set result to dynamic
shape even when size is static.
With this change,
- `size` is computed as `ceil(limit-start)/stride` (these are
stablehlo slice op attributes) and NOT as shape of output.
- A new builder is added.
MLIR test is added.stablehlo.slice conversion1 parent 7fc38c8 commit 8f87f14
File tree
4 files changed
+44
-8
lines changed- mlir-tensorrt
- compiler/lib/Conversion/StablehloToTensorRT
- tensorrt
- include/mlir-tensorrt-dialect/TensorRT/IR
- lib/TensorRT/IR
- test/Conversion/StablehloToTensorRT
4 files changed
+44
-8
lines changedLines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
1947 | 1949 | | |
1948 | 1950 | | |
1949 | 1951 | | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
1950 | 1957 | | |
1951 | 1958 | | |
1952 | 1959 | | |
1953 | 1960 | | |
1954 | 1961 | | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
1959 | | - | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
1960 | 1968 | | |
1961 | | - | |
1962 | | - | |
| 1969 | + | |
| 1970 | + | |
1963 | 1971 | | |
1964 | 1972 | | |
1965 | 1973 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1628 | 1628 | | |
1629 | 1629 | | |
1630 | 1630 | | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1631 | 1636 | | |
1632 | 1637 | | |
1633 | 1638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1139 | 1150 | | |
1140 | 1151 | | |
1141 | 1152 | | |
| |||
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1927 | 1927 | | |
1928 | 1928 | | |
1929 | 1929 | | |
1930 | | - | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
0 commit comments