Repository navigation
compiler: Key the injective storage exemption on a zero distance - #3092
Merged
Merged
Conversation
An injective Dimension was exempted from `is_storage_related` outright. That
is too strong: injectivity says distinct iterations map to distinct indices,
so only the *same* iteration can reach a given location -- it says nothing
about two different offsets off that Dimension, which do collide.
`is_storage_related` also gates fusion and lifting, so the blanket exemption
split `f[ci]` and `f[ci+1]` into separate loops, and the second overwrote what
the first produced instead of interleaving per iteration:
Eq(g, i), Eq(f, g), Eq(f[ci+1], g, implicit_dims=cend)
# f == [0, 0, 4, 8, 12, 16], one slot off throughout
Require a zero distance for the exemption, which is exactly the subsampled
`Inc` it was added for, and leave every other dependence as before.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3092 +/- ##
=======================================
Coverage 84.39% 84.40%
=======================================
Files 260 260
Lines 58125 58153 +28
Branches 4943 4948 +5
=======================================
+ Hits 49054 49082 +28
Misses 8248 8248
Partials 823 823
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`DummyEq(lhs, rhs)` wrapped its arguments in a DSL `Eq` and pushed them back
through `LoweredEq`'s lowering path. But its callers are compiler passes
holding already-lowered IR, so the DSL-to-IR rewrites ran a second time.
For most LHSs that is a no-op, which is why it went unnoticed. A
ConditionalDimension LHS, though, becomes `IntDiv(parent, factor)` -- an
expression, not an assignment target. A backend that emits an index
assignment then produces
IntDiv(time, ctf) = ct_m + (int)idx[0]
and `LoweredEq.dtype` raises `AttributeError: 'IntDiv' object has no
attribute 'dtype'`. The SYCL parallelizer does exactly this for its
parallel_for indices, where every other backend prints the loop variable by
name and so never looks at the lowered form.
Construct the ClusterizedEq directly instead, as the class docstring already
describes. `LoweredEq`'s own two-argument form bypasses lowering for the same
reason.
FabioLuporini
approved these changes
Oct 26, 2026
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.
No description provided.