feat(compile-hlo): lower clamp to stablehlo.clamp (#1247) - #1253
Merged
Merged
Conversation
The traced clamp(x, minVal, maxVal) op had no converter at all — the first registry gap the strict gemma3n export surfaced once conversion failures stopped being MLIR comments. Lowers to stablehlo.clamp with the bounds as splat constants of the output type; missing bounds are a Failure, not a registry miss. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nverter # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Fable 5.1 <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.
Follow-up to #1248 for #1247. With conversion failures no longer hidden as comments, the gemma3n export's first real gap is that the traced
clamp(x, minVal, maxVal)op had no converter at all (No converter found for operation: clampat node n14 of the E2B trace).ScalarOperationsConverternow claimsclamp: the bounds (recorded by the tracer asminVal/maxVal) become splat constants of the output type and the op lowers tostablehlo.clamp %min, %x, %max. Missing bounds are aFailurewith a named message, not a registry miss.Testing: new
ClampConverterTest(lowering shape + missing-bounds failure); full compile-hlo suite green.