Skip to content

feat(compile-hlo): lower clamp to stablehlo.clamp (#1247) - #1253

Merged
michalharakal merged 5 commits into
developfrom
feat/1247-clamp-converter
Sep 2, 2026
Merged

michalharakal merged 5 commits into
developfrom
feat/1247-clamp-converter

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

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: clamp at node n14 of the E2B trace).

  • ScalarOperationsConverter now claims clamp: the bounds (recorded by the tracer as minVal/maxVal) become splat constants of the output type and the op lowers to stablehlo.clamp %min, %x, %max. Missing bounds are a Failure with a named message, not a registry miss.

Testing: new ClampConverterTest (lowering shape + missing-bounds failure); full compile-hlo suite green.

michalharakal and others added 5 commits September 2, 2026 11:48
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>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…exception (#1247)

Written before #1248 made Failure results throw by default.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@michalharakal
michalharakal merged commit 7262a89 into develop Sep 2, 2026
14 checks passed
@michalharakal
michalharakal deleted the feat/1247-clamp-converter branch September 2, 2026 10:26
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.

1 participant