Commit 41baa7b
authored
Disallow shape inference (#128)
The current status quo did shape inference on _some_ layers but not all. This was done through the `computeShapes` method of the ONNXLayer and by examining the implementations of that method, we can see that some calculate the output shape out of the input shapes, but some just blindly copy the tensor's shape.
I propose we disallow shape inference and if we want to properly support this feature we can revert this change and implement it properly or depend on another tool to do it for us (e.g. [ONNX's shape inference module](https://onnx.ai/onnx/api/shape_inference.html)).
Now, I have disallowed shape inference after lowering because some lowerings actually consumed shapeless tensors and produced correct replacements, but some lowerings produced shapeless tensors themeselves, specifically, the MHSA pass in MemPool. I have disabled all tests that used those lowerings which can be re-enabled once the offending lowerings get fixed. I will create an issue following this if this PR gets accepted.
## Added
- Added assertion that all the graph tensors after lowering have a shape annotated
## Changed
- Disabled ICCT_ITA_8 MemPool test because it was using a lowering that created shapeless tensors
- Added missing shape annotation to the testTypeInferenceDifferentTypes1 parent 5db6de3 commit 41baa7b
File tree
4 files changed
+12
-1
lines changed- .github/workflows
- DeeployTest/Tests/testTypeInferenceDifferentTypes
- Deeploy
4 files changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | 72 | | |
74 | 73 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3372 | 3372 | | |
3373 | 3373 | | |
3374 | 3374 | | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
3375 | 3380 | | |
3376 | 3381 | | |
3377 | 3382 | | |
| |||
3419 | 3424 | | |
3420 | 3425 | | |
3421 | 3426 | | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
3422 | 3430 | | |
3423 | 3431 | | |
3424 | 3432 | | |
| |||
Binary file not shown.
0 commit comments