Repository navigation
Reuse retained physical backing during warmup retention - #190
Closed
original-el8 wants to merge 1 commit into
Closed
original-el8 wants to merge 1 commit into
original-el8 wants to merge 1 commit into
Conversation
Retaining transient physical handles across compiled-forward warmup keeps every retired warmup segment alive until the catalog completes, so peak preparation memory grows by the full transient footprint of each warmup forward instead of the largest concurrent footprint. Qwen3.8 Flash Next TP1 export at the recipe default concurrency of 32 exhausts a 96 GB RTX PRO 6000 during compiled warmup. Donate retained physical backing to allocation: flare_package_allocate first maps a retained handle of the exact requested size instead of creating fresh physical storage, and a failed map returns the handle to the retained set. Retained memory is then bounded by distinct transient sizes rather than the warmup count, while physical allocations still survive the retention scope and release completely at finish(). Aborted scopes donate nothing. Package and serving contracts are unchanged; Heliopause must be rebuilt. Validation: 7 allocator unit tests pass, including donation take, failed-map return, and complete-drain release. An RTX PRO 6000 probe allocating and freeing two repeating 1 GiB transients twelve times inside a retention scope held retained backing at 1 GiB and released all of it at finish. Full-catalog TP1 export of nvidia/Qwen3.8-Flash-Next-FP4-Local at recipe defaults completed on a 96 GB RTX PRO 6000 (112 graphs; package gb202-tp1-202611031940), where retention without reuse exhausts device memory during compiled warmup. SM103 and Windows execution are untested; the allocator change is hardware-agnostic and the retention contract is unchanged. Design-Signed-Off-By: flare-02; design-review=1c01
Collaborator
Author
|
Closing in favor of #154, which fixes the same retained-warmup accumulation with a more complete mechanism: pooled whole mappings instead of exact-size handle remaps, explicit handling of the SM120 sub-range remap constraint (CUDA_ERROR_NOT_SUPPORTED), failed-unmap recovery, and snapshot accounting for reused references. It is also validated on more hardware (four 96 GB RTX PRO 6000 cards, DeepSeek V4.1 Flash TP4). I have posted this PR's independent validation on #154 — Qwen3.8 Flash Next TP1 export at recipe defaults completing on a 96 GB card with the fix class, tying it to #187. |
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.
Warmup retention exhausts device memory on 96 GB GPUs
Compiled-forward warmup retains the physical backing of every retired transient allocation until the catalog completes, so peak preparation memory grows by the sum of all warmup forwards' transient footprints instead of the largest concurrent footprint. Qwen3.8 Flash Next TP1 export at the recipe default concurrency of 32 exhausts a 96 GB RTX PRO 6000 during compiled warmup (~1 GiB retained per forward, OOM by forward ~51), as reported by @mark-yong for Qwen3.8-27B and Qwen3.8-Flash-Next TP1 on 96 GB GPUs (#187), with matching reports from Johannes Bertens (model-card documentation) and local-inference-lab Discord users (TP1 allocation shortfalls of 20–128 MiB). @mark-yong's diagnostic with retention disabled (exports completing without CUDA errors on driver 615.71.09) confirmed retention as the sole accumulation source. DGX Spark (128 GB unified) fits the accumulated backing and does not observe the failure.
Fix
Donate retained physical backing to allocation:
flare_package_allocatemaps a retained handle of the exact requested size instead of creating fresh physical storage, and a failed map returns the handle to the retained set. Retained memory is then bounded by distinct transient sizes rather than the warmup count, while physical allocations still survive the retention scope (preserving theCUDA_ERROR_ILLEGAL_INSTRUCTIONworkaround) and release completely atfinish(). Aborted scopes donate nothing.Package and serving contracts are unchanged; Heliopause must be rebuilt.
Validation
finish().Closes #187's export-failure case for Qwen3.8 Flash Next TP1 and Qwen3.8-27B:
--max-concurrency 8and tmpfs staging are no longer needed to export at recipe defaults. Credit to @mark-yong for the root-cause diagnosis (retention disabled → export completes) and to Johannes Bertens and the Discord reporters for the corroborating deployment data.