Commit 300e368
authored
Fix DecomposeConcatenate passing invalid out_dtype kwarg to quantize_per_tensor (#18569)
### Summary
When decomposing a quantized `cat` with more than 5 inputs,
`DecomposeConcatenate` inserts an intermediate Q/DQ pair. Previously it
shared the same `kwargs` dict (copied from the original
`dequantize_per_tensor` node) for both the `quantize_per_tensor` and
`dequantize_per_tensor` nodes.
However, `quantize_per_tensor.default` does not accept `out_dtype` —
only `dequantize_per_tensor.default` does. This causes failures for
models where the dequantize node carries `out_dtype` (e.g., fp16
quantized models).
This PR splits the kwargs so that `out_dtype` is excluded from the
quantize node kwargs while preserved for the dequantize node.
### Test plan
Existing tests pass:
```
python -m unittest backends.xnnpack.test.passes.test_decompose_cat_pass -v
```
```
test_cat_gt_10 ... ok
test_cat_gt_5 ... ok
test_qs8_cat_gt_10 ... ok
test_qs8_cat_gt_5 ... ok
```
cc @GregoryComer @digantdesai @cbilgin1 parent 042151d commit 300e368
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
92 | | - | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
0 commit comments