Follow-up to #673 / #674. #674 fixed reshape/matmul/concat output-spec inference; verified end-to-end against an unsigned 0.28.1-SNAPSHOT published to mavenLocal and run through the skainet-iree-conformance harness:
- op micro-suite: 23/27
iree-compile to a vmfb (was 20/27 on 0.28.0; reshape/matmul/concat now pass)
- models: 6/7 compile (grayscale, tiny-mlp, whisper, yolo, leaf-embed, gemma3-260m)
Still failing — this issue: conv1d, gather, maxpool2d, avgpool2d (and the mnist-cnn model, via maxpool).
Repro test (committed, RED)
Branch test/dag-conv-gather-pool-shape-673b → DagConvGatherPoolExportTest (real dag{} DSL path). 4 tests, all RED on develop after #674.
Two root causes
1. inferDagOutputSpecs has no rule for conv1d / gather / pooling
Same gap #674 closed for matmul/concat — these still fall back to echoing operand-0's shape, so the declared result/return type contradicts the value iree-compile infers:
op_conv1d (x:1x3x8, w:4x3x3, stride 1 pad 0) declared 1x3x8, true 1x4x6
error: inferred shape '[1, 4, 6]' is incompatible with return type 'tensor<1x3x8xf32>'
op_gather (table:8x4, idx:3, axis 0) declared 8x4, true 3x4
error: 'stablehlo.gather' op inferred type(s) 'tensor<3x4xf32>' are incompatible with return type(s) 'tensor<8x4xf32>'
op_maxpool2d / op_avgpool2d (1x3x8x8, 2x2 s2) declared 1x3x8x8, true 1x3x4x4
Note: conv2d already passes — only conv1d is wrong. Extend inferDagOutputSpecs with conv (out = floor((in + 2·pad − dilation·(k−1) − 1)/stride)+1, channels = weight[0]), gather (indices.shape ⊕ table.shape without the gathered axis), and pooling (same windowed formula as conv).
2. reduce_window is emitted in a form IREE rejects
op_maxpool2d:5:11: error: custom op 'stablehlo.reduce_window' has no custom assembly form
The converter emits the pretty stablehlo.reduce_window(%a, %init) applies stablehlo.maximum over window dimensions = … form. IREE's parser needs the generic region-based form ("stablehlo.reduce_window"(%a, %init) ({ ^bb0(...): stablehlo.return ... }) {window_dimensions = …, …}). This blocks both pooling ops and the mnist-cnn model. (Same class as the gather/slice emission fixes in 0.27.0.)
Acceptance
DagConvGatherPoolExportTest (4) green.
- Harness op micro-suite reaches 27/27 compile and mnist-cnn compiles to a vmfb on llvm-cpu.
Verified via mavenLocal 0.28.1-SNAPSHOT + skainet-iree-conformance.
Follow-up to #673 / #674. #674 fixed
reshape/matmul/concatoutput-spec inference; verified end-to-end against an unsigned0.28.1-SNAPSHOTpublished to mavenLocal and run through theskainet-iree-conformanceharness:iree-compileto a vmfb (was 20/27 on 0.28.0;reshape/matmul/concatnow pass)Still failing — this issue:
conv1d,gather,maxpool2d,avgpool2d(and themnist-cnnmodel, via maxpool).Repro test (committed, RED)
Branch
test/dag-conv-gather-pool-shape-673b→DagConvGatherPoolExportTest(realdag{}DSL path). 4 tests, all RED on develop after #674.Two root causes
1.
inferDagOutputSpecshas no rule forconv1d/gather/ poolingSame gap #674 closed for matmul/concat — these still fall back to echoing operand-0's shape, so the declared result/return type contradicts the value
iree-compileinfers:2.
reduce_windowis emitted in a form IREE rejectsThe converter emits the pretty
stablehlo.reduce_window(%a, %init) applies stablehlo.maximum over window dimensions = …form. IREE's parser needs the generic region-based form ("stablehlo.reduce_window"(%a, %init) ({ ^bb0(...): stablehlo.return ... }) {window_dimensions = …, …}). This blocks both pooling ops and themnist-cnnmodel. (Same class as thegather/sliceemission fixes in 0.27.0.)Acceptance
DagConvGatherPoolExportTest(4) green.Verified via mavenLocal
0.28.1-SNAPSHOT+skainet-iree-conformance.