Repository navigation
fix(trainer-rank): credit reusable cache when placing gathered outputs - #1100
Draft
bradhilton wants to merge 4 commits into
Draft
bradhilton wants to merge 4 commits into
bradhilton wants to merge 4 commits into
Conversation
Gathered-output placement budgeted explicit model-device copies against physical free memory alone. On the native allocator that excludes PyTorch's cache, so right after a forward, with freed activations cached, the budget fell to zero and refused even a 623 KiB logprob copy (Hayek's 060). Output placement now credits reserved minus active bytes when the allocator counters are consistent; frees pending on other streams stay excluded. Planning admission keeps its physical-only budget. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bradhilton
had a problem deploying
to
trainer-rank-gpu-validation
October 3, 2026 13:36 — with
GitHub Actions
Error
…ache credit Credit reusable cache only when the native allocated, active and reserved counters are all present, exact integers; a missing, boolean or fractional allocated counter no longer grants credit. Placement-path test budgets now accept the keyword (output memory, aggregate outputs, CUDA canary). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bradhilton
had a problem deploying
to
trainer-rank-gpu-validation
October 3, 2026 13:48 — with
GitHub Actions
Error
Inactive cache does not guarantee an allocatable block for a given request (split large-pool blocks, small pool, stream-private caches), so crediting it to optional auto placement could pick GPU and then OOM where the physical budget would have chosen CPU. Only explicit model-device outputs, which would otherwise be refused, are checked against the cache-credited budget; auto placement keeps the physical one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bradhilton
had a problem deploying
to
trainer-rank-gpu-validation
October 3, 2026 14:00 — with
GitHub Actions
Failure
…ent-cache-credit # Conflicts: # src/art/trainer_rank/_commands.py # src/art/trainer_rank/_memory_policy.py
bradhilton
deployed
to
trainer-rank-gpu-validation
October 3, 2026 14:49 — with
GitHub Actions
Active
This branch was successfully 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.
Agent: Dalinar
Problem
Hayek's 060 run failed its first training call, before any optimizer update, with
MemoryError: Gathered model-device outputs require 637760 GPU bytes; only 0 bytes are available. There was no CUDA OOM.#925's output placement budgets explicit model-device copies (the default
output_device="model") as physical free memory, minus the 3% reserve, minus pending backward reserves. On the native allocator,_available_memory_bytesgives no credit for PyTorch's reusable cache. So whenever the allocator holds most of the GPU as cached, freed blocks, which is typical right after a forward, the budget can read zero (the reserve is about 4.2 GiB on an H200) while the copy could be served from cache. A CPU repro on ad170 shows this: 47 GiB of reusable cache and 3 GiB physical free give a budget of 0.This is a default-mode correctness gap whatever caused 060. 060 retained no allocated/reserved/staging operands at the refusing gate, and the nearest NVML sample (about 39 GiB free) was taken at a different time. So this PR does not claim the cache exclusion caused 060; pending-backward reserves remain a possible contributor.
Behavior
reserved - active, through_available_memory_bytes(reusable_cache=True). Frees pending on other streams stay active and are not credited.autooutputs keep the physical-only budget. Inactive cache doesn't guarantee an allocatable block (split large-pool blocks, the small pool, stream-private caches), so crediting it could send anautooutput to GPU and OOM where CPU would have worked.0 <= allocated <= active <= reserved); otherwise there is none.autoagainst the physical one. This fixes default-mode consumers too.Validation
autokeeps the physical one; it fails without the credit. Placement-path test budgets accept the new keyword. The 243 related tests pass.Limits
🤖 Generated with Claude Code