Skip to content

feat(stablehlo): add emitter for reductions and Softmax decomposition#64

Merged
dndungu merged 1 commit intomainfrom
p2-emit-reduce
Apr 4, 2026
Merged

feat(stablehlo): add emitter for reductions and Softmax decomposition#64
dndungu merged 1 commit intomainfrom
p2-emit-reduce

Conversation

@dndungu
Copy link
Copy Markdown
Contributor

@dndungu dndungu commented Apr 4, 2026

Summary

  • Add StableHLO emitter for reduction operations
  • Implement Softmax decomposition into StableHLO primitives

Test plan

  • Verify reduction emission produces valid StableHLO
  • Verify Softmax decomposition roundtrips correctly

Emit StableHLO MLIR for ReduceSum (add body), ReduceMax (maximum body),
ReduceMean (sum + divide by axis size), and Softmax (5-op decomposition:
max, subtract, exp, sum, divide). Each reduction emits an inline region
body with block arguments. KeepDims support via reshape.
@dndungu dndungu merged commit c8db036 into main Apr 4, 2026
1 check failed
@dndungu dndungu deleted the p2-emit-reduce branch April 4, 2026 01:14
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