Repository navigation
Conversation
wsmoses
force-pushed
the
pb/xla-exec-chunks
branch
from
October 12, 2026 10:25
38e25d2 to
5a681ea
Compare
Member
Author
|
Fixed the test-localjll build: the GpuExecutable code is now under REACTANT_CUDA/REACTANT_ROCM (tempBytes is 0 elsewhere), and the BUILD deps declare @xla//xla/service/gpu:gpu_executable (cuda and rocm lists) and @xla//xla/stream_executor/integrations:tf_allocator_adapter. |
wsmoses
force-pushed
the
pb/xla-exec-chunks
branch
from
October 12, 2026 11:12
5a681ea to
d309c09
Compare
XLA allocates the values an executable keeps as one temporary, and a raised kernel's batched parallel loops keep a value per iteration of many of them: past some problem size the executable cannot run (MFEM ceed BP3 order 4 at side 240: 35.79 GiB; BP4: 47.29 GiB). After compiling, the runtime now reads the executable's temporary bytes; when they exceed what the allocator has left (90%; else half the device; or REACTANT_EXEC_TEMP_BUDGET), it compiles the module again from the start asking the pattern list for parallel_while_to_batched_scatter_chunked(N) -- the loops batched N chunks at a time -- and without greedy_while_loop_batch_fission, which lifts ops out of a loop over all its iterations at once. N grows with the overshoot, again while the temporary still shrinks. Modules that fit are compiled exactly as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
wsmoses
force-pushed
the
pb/xla-exec-chunks
branch
from
October 12, 2026 11:17
d309c09 to
8496669
Compare
This branch has not been deployed
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.
Stacked on #3435 (the linkable-runtime stack). Needs EnzymeAD/Enzyme-JAX#3481 for the
parallel_while_to_batched_scatter_chunkedpattern op. The chunked retry only runs for a module that would otherwise run out of memory, so before an Enzyme-JAX bump that case fails in the pipeline instead of at allocation.XLA allocates all the values an executable keeps as one temporary. A raised kernel's batched parallel loops keep a value per iteration for many of them, so past some problem size the executable can't run. MFEM ceed at order 4, side 240 (216,000 elements): BP3 needs a 35.79 GiB temporary, BP4 47.29 GiB.
Change:
REACTANT_EXEC_TEMP_BUDGEToverrides.parallel_while_to_batched_scatter_chunked(N)in place ofparallel_while_to_batched_scatter, and withoutgreedy_while_loop_batch_fission, which lifts ops out of a loop over all its iterations at once and was the source of the 47 GiB.Nstarts at ⌈temp/budget⌉ (at least 2) and keeps multiplying while the temporary is over budget, up to 1024; past that, the attempt with the smallest temporary is used. More chunks can also let loops batch that a whole batch couldn't, so the temp isn't monotone: ceed BP4/2/160 needed 22.9 GB with 1 chunk, 34.8 GB with 2, and 9.6 GB with 6.specializeRaw) does the same. Its pipeline would otherwise rebuild the oversized executable from the already-optimized text.REACTANT_CUDA/REACTANT_ROCM, and BUILD declares its deps.Measured (RTX 5090; Enzyme-JAX with #3481; native = clang CUDA):
REACTANT_XLA_MEM_FRACTION=0.92For BP4/4/240, the chunked temporary is 9.66 GiB, but the default 75% pool holds 14.5 GiB of arguments.
🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD