Skip to content

test(compile-hlo): trace-mode conv2d/maxPool2d/upsample2d export regression (#1219) - #1257

Merged
michalharakal merged 1 commit into
developfrom
test/1219-trace-conv-pool-upsample-export
Sep 2, 2026
Merged

michalharakal merged 1 commit into
developfrom
test/1219-trace-conv-pool-upsample-export

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Closes #1219.

The issue's symptom — a trace-mode (network{}/sequential{}) model using conv2d, maxPool2d, upsample2d exported through toStableHlo emitting // Unsupported op '<name>' for every such node and still "succeeding" — is fixed on develop by #1248: toStableHlo uses StableHloConverterFactory.createBasic, which never registered NeuralNetOperationsConverter (the "Known names" list in the issue genuinely has no convolution/pooling/upsampling entries), and conversion is now strict, so a registry miss can no longer masquerade as a successful export.

This PR pins it with an end-to-end regression on the trace path: conv2d → maxPool2d → upsample2d recorded through the KSP tracing wrapper on a void context, toComputeGraph(synthesizeExternalInputs = true, inputTensorIds = …), then toStableHlo under the default STRICT policy — asserting stablehlo.convolution, a reduce_window pooling, the static shapes (tensor<1x4x8x8xf32> / tensor<1x4x4x4xf32>) and no Unsupported op / Conversion failed text.

Verified as a real reproduction: with #1248's createBasic registration temporarily removed, the test fails with HloConversionException: … No converter found for operation: conv2d at n0_conv2d — exactly the issue's first failing node. The tracer's attribute spellings (stride/padding/dilation/groups as pairs, kernelSize, scale/mode/alignCorners) already match what NeuralNetOperationsConverter reads, so no converter change was needed. Full compile-hlo suite green.

…ession (#1219)

Records conv2d -> maxPool2d -> upsample2d through the KSP tracing wrapper on
a void context (the network{}/sequential{} path the issue describes, not
dag{}), builds the graph with synthesized inputs, and exports through
toStableHlo — the issue's exact entry point, createBasic under the default
STRICT policy. Asserts stablehlo.convolution, a reduce_window pooling, static
shapes end to end, and no registry misses.

Verified as a genuine reproduction: with createBasic's
NeuralNetOperationsConverter registration (#1248) removed, the test fails
with 'No converter found for operation: conv2d' at n0_conv2d — the issue's
symptom, now a hard error instead of a comment. The tracer's attribute
spellings (stride/padding/dilation/groups pairs, kernelSize,
scale/mode/alignCorners) already match what the converter reads.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@michalharakal
michalharakal merged commit fa7ecaa into develop Sep 2, 2026
14 checks passed
@michalharakal
michalharakal deleted the test/1219-trace-conv-pool-upsample-export branch September 2, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trace-mode conv2d/maxPool2d/upsample2d aren't recognized by the StableHLO exporter

1 participant