feat(compile-hlo)!: strict-by-default conversion errors, indexSelect routing, createBasic parity (#1247) - #1248
Merged
Conversation
…routing, createBasic parity (#1247) Converter failures were MLIR comments: a graph whose first node failed to lower cascaded through every downstream node and still emitted a compute-free module with an empty return and exit 0. Conversion now aborts by default — ConversionErrorPolicy.STRICT throws HloConversionException on any unconvertible node, and resolveOperands throws MissingOperandException instead of silently dropping unresolved operands and shifting later ones into earlier positional slots (the gather-cascade defect). LENIENT restores the historical comment-and-continue behavior. Also closes two registry gaps the gemma3n export tripped over: the KSP tracing wrapper emits 'indexSelect' but only 'index_select' was routable, and createBasic never registered NeuralNetOperationsConverter (registered in createExtended's relative position so op-name precedence is unchanged). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Sep 2, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1247 (the comment's ask 1: operand-linkage failures must be a hard error).
Converter failures were MLIR comments: a graph whose first node failed to lower cascaded through every downstream node and still emitted a compute-free module with an empty
returnand exit 0.ConversionErrorPolicy(defaultSTRICT) onStableHloConverterand every factory entry point: an unconvertible node throwsHloConversionException;ConversionContext.resolveOperandsthrowsMissingOperandExceptioninstead ofmapNotNull-dropping unresolved operands (which also shifted later operands into earlier positional slots — the gather cascade).LENIENTrestores comment-and-continue.GatherOperationsConverterroutesindexSelect(the spelling the KSP tracing wrapper actually emits; onlyindex_selectwas registered) — both insupportedOperationsand the lowercased dispatch ("indexselect"≠"index_select").createBasicregistersNeuralNetOperationsConverter, atcreateExtended's relative position so last-writer-wins op-name precedence is unchanged.Testing: new
ConversionStrictnessTest(named-exception on unresolved producer, LENIENT drop/shift contract, strict throw on unknown op / Failure result, createBasic rmsNorm routing) +indexSelectcase inGatherConverterTest. All 219 pre-existing module tests pass unchanged under STRICT; downstreamskainet-test-java/skainet-io-iree-paramssuites green; apiDump updated.Verified against the gemma3n repro (composite build, full E2B): the export now fails loudly at its first real gap —
clamphas no converter at all (follow-up) — instead of emitting a 190+-arg module with exit 0, and the old first failure (n0_gatheroperand linkage) no longer occurs.