Skip to content

IotaSimplify: an iota along a dimension of size 1 is a splat 0 - #3412

Merged
wsmoses merged 1 commit into
mainfrom
pb/iota-unit-dim-zero
Oct 7, 2026
Merged

wsmoses merged 1 commit into
mainfrom
pb/iota-unit-dim-zero

Conversation

@wsmoses

@wsmoses wsmoses commented Oct 7, 2026

Copy link
Copy Markdown
Member

An iota along a dimension of size 1 is all zeros. IotaSimplify now folds it to a splat 0 at any size. Before, iotas were only folded to constants below the max_constant_expansion threshold, so a large one such as tensor<1x2048xi64> stayed an iota.

This follows up #3410. With this change, a broadcast of a size-1 iota folds to a zero constant through the iota itself.

iota_unit_dim.mlir covers an integer case and a float case above the threshold, plus a counting iota above the threshold that is still left alone.

🤖 Generated with Claude Code

https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD

Counting along a dimension of size 1 never gets past 0, so such an iota
is a zero constant at any size; fold it even above the constant
expansion threshold, where a counting iota is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
@wsmoses
wsmoses merged commit 1094062 into main Oct 7, 2026
16 of 21 checks passed
@wsmoses
wsmoses deleted the pb/iota-unit-dim-zero branch October 7, 2026 13:46
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.88%. Comparing base (9409410) to head (e09e049).
⚠️ Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3412      +/-   ##
==========================================
- Coverage   29.61%   27.88%   -1.74%     
==========================================
  Files         240      240              
  Lines       48460    48483      +23     
==========================================
- Hits        14351    13518     -833     
- Misses      34109    34965     +856     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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