reactantXLAExec: address an offset argument view as a slice of its base buffer - #3286
Merged
Merged
Conversation
wsmoses
force-pushed
the
pb/offset-view-slices
branch
from
September 14, 2026 14:35
de66af3 to
17aa37b
Compare
wsmoses
force-pushed
the
pb/donate-only-written
branch
2 times, most recently
from
September 14, 2026 14:40
0375f13 to
96aa666
Compare
wsmoses
force-pushed
the
pb/offset-view-slices
branch
from
September 14, 2026 14:40
17aa37b to
a632632
Compare
wsmoses
force-pushed
the
pb/donate-only-written
branch
from
September 14, 2026 14:43
96aa666 to
ff47913
Compare
wsmoses
force-pushed
the
pb/offset-view-slices
branch
from
September 14, 2026 14:43
a632632 to
99d8b56
Compare
wsmoses
force-pushed
the
pb/offset-view-slices
branch
4 times, most recently
from
September 15, 2026 07:09
321e53a to
a6a389c
Compare
wsmoses
force-pushed
the
pb/offset-view-slices
branch
from
September 15, 2026 17:14
a6a389c to
dc71ef6
Compare
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.
Replaces #3240's host staging. Depends on the read-only-argument change (the PR this branch is stacked on).
A kernel argument may point into the middle of an allocation: MFEM's
BlockVectorblocks areMakeRefviews into one buffer, and everything launched on a block (LinearForm::Assembleonrhs.GetBlock(1), the sub-operatorMults inBlockOperator::Mult) receives base + offset. Instead of copying the tail out to a temporary buffer and back around every launch, the executable takes the base buffer itself. Before the pipeline runs, the argument's type becomes the base buffer's type, every use of it readsstablehlo.slice %base[offset : size], and the value returned for it becomesstablehlo.dynamic_update_slice(%base, %result, offset). The optimizer then folds the update of an unchanged view back to the base argument, so a read-only view is recognized by identity like any other argument (not donated, not returned), and a written view donates its base buffer and returns the updated base, which the runtime stores back into the allocation. The offsets are part of the executable cache key.No host round trip, the parent buffer keeps aliasing with its blocks, and XLA fuses the slice and the update into the kernel. A view that is not a whole number of elements into a 1-D buffer aborts with a message.
Validation on the MFEM GPU unit-test suite (BlockOperators is the test that exercises this) is running; will update.
🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD