Skip to content

While raising: broadcast under-attributed yields to the carried layout - #3002

Open
wsmoses wants to merge 1 commit into
mainfrom
pb/yield-broadcast
Open

While raising: broadcast under-attributed yields to the carried layout#3002
wsmoses wants to merge 1 commit into
mainfrom
pb/yield-broadcast

Conversation

@wsmoses

@wsmoses wsmoses commented Aug 28, 2026

Copy link
Copy Markdown
Member

mfem's bilininteg_diffusion_kernels.cpp accumulators chain through index-table gathers whose raised values lose their lane attribution (a () -> () map with a tensor type); the while raising then rejected the loop because the yield's layout could not be permutation-matched to the carried argument. Broadcast the yield up to the carried layout via alignMemoryAccess before matching, and let alignMemoryAccess report incompatibility through an ok out-flag instead of asserting on accesses it cannot size.

The tridiagonal golden changes form: the align at the loop tail now emits a permuting broadcast_in_dim (dims = [0, 3, 1, 2]) instead of a transpose — equivalent IR.

Part of #2968.

🤖 Generated with Claude Code

https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD

A loop-carried value can be yielded with fewer attributed axes than the
carried argument (a uniform chain through an index-table gather loses
its lane attribution), which made the permutation matching reject the
loop. Broadcast the yield up to the carried layout first, and let
alignMemoryAccess report incompatibility through an ok flag instead of
asserting on accesses it cannot size.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
Comment on lines 1537 to 1538
auto perm = memoryEquivalentPermutation(maps.lookup(raisedYieldedIterArg),
maps.lookup(raisedIterArg));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would change the memoryEquivalentPermutation here to be more permissive then since it's only used for this case.

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.

2 participants