You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The native CUDA allocator can report a tensor as no longer allocated while its block is still waiting for work on another stream. Counting reserved - allocated as reusable memory credits those pending blocks before the allocator can reuse them.
Use one native memory_stats snapshot and credit reserved - active when allocated/active/reserved counters are consistent nonnegative integers. Missing or inconsistent native counters grant no cache credit; real CUDA API errors still propagate. Keep the existing physical free-memory read, 3% reserve, test-only allocation ceiling and collective ordering. Other allocator backends retain their previous policy, explicitly outside this fix's qualification.
Partial progress on #870: this excludes pending bytes only. It does not resolve private-pool ownership, split-block compatibility, contiguous allocation or external-library headroom. Completed events that the allocator has not yet collected can cause conservative refusal or splitting. No snapshot, synchronization, event query, cache release, public API, art.megatron, dependency or loss changes. Held #888 is not included. This PR is independent of #893/#894.
Validation: 26 targeted CPU tests pass on this exact standalone main-based tree, plus 34 independent source/CPU checks using retained native-layout evidence and API/error/ceiling/reduction boundaries. Ruff, format and diff checks pass. Retained native evidence establishes counter semantics; this candidate has not yet been exercised in a new live GPU workload. Actual prior failures and completed test-resource receipts remain preserved.
Exact head 97df0e071fdae9006096dc1004813c4fd1dc7ce0, base 2ebfc1c2a38dbeeaeefac998323b476989602942. Request explicit behavioral-eligibility assessment under Brad's standing conditions before any merge.
Durable evidence: /home/brad/.local/share/schulman/art870-active-credit-main-20260914-physical-headroom/ (read REPORT-CORRECTION.md alongside the original report) and /home/brad/.local/share/schulman/art870-credit-review-20260914-forward-7zvh91s1/REPORT.md.
Consolidated review record (automated agent review traffic removed 2026-09-17)
Change._available_memory_bytes credits reserved - active from one native memory_stats snapshot instead of reserved - allocated, so CUDA blocks awaiting cross-stream events are not counted as reusable cache. Malformed counters grant no credit; other backends unchanged. Partial progress on #870.
Review. Taravangian, Minsky and McCarthy reviewed the merged head 97df0e0 against the pinned PyTorch allocator source and each returned source-correctness CLEAR, but held automatic merge eligibility because the stricter credit intentionally changes refusal/splitting behavior. Evidence: owner's 26 targeted CPU tests plus 34 controls (inspected, not rerun); Minsky reran both test files (38 passed; negative control on main failed the 19 new cases); ruff/format/diff clean; Prek and two-H200 CI still running during review.
Not yet exercised in a live GPU workload; Minsky suggested telemetry if the counter-consistency check fires.
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
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.
The native CUDA allocator can report a tensor as no longer allocated while its block is still waiting for work on another stream. Counting
reserved - allocatedas reusable memory credits those pending blocks before the allocator can reuse them.Use one native
memory_statssnapshot and creditreserved - activewhen allocated/active/reserved counters are consistent nonnegative integers. Missing or inconsistent native counters grant no cache credit; real CUDA API errors still propagate. Keep the existing physical free-memory read, 3% reserve, test-only allocation ceiling and collective ordering. Other allocator backends retain their previous policy, explicitly outside this fix's qualification.Partial progress on #870: this excludes pending bytes only. It does not resolve private-pool ownership, split-block compatibility, contiguous allocation or external-library headroom. Completed events that the allocator has not yet collected can cause conservative refusal or splitting. No snapshot, synchronization, event query, cache release, public API,
art.megatron, dependency or loss changes. Held #888 is not included. This PR is independent of #893/#894.Validation: 26 targeted CPU tests pass on this exact standalone main-based tree, plus 34 independent source/CPU checks using retained native-layout evidence and API/error/ceiling/reduction boundaries. Ruff, format and diff checks pass. Retained native evidence establishes counter semantics; this candidate has not yet been exercised in a new live GPU workload. Actual prior failures and completed test-resource receipts remain preserved.
Exact head
97df0e071fdae9006096dc1004813c4fd1dc7ce0, base2ebfc1c2a38dbeeaeefac998323b476989602942. Request explicit behavioral-eligibility assessment under Brad's standing conditions before any merge.Durable evidence:
/home/brad/.local/share/schulman/art870-active-credit-main-20260914-physical-headroom/(readREPORT-CORRECTION.mdalongside the original report) and/home/brad/.local/share/schulman/art870-credit-review-20260914-forward-7zvh91s1/REPORT.md.