Apply the allocator gc-gate fix to SD21/SDXL#25
Closed
TroyHernandez wants to merge 2 commits into
Closed
Conversation
load_pipeline() now routes through .flux_gc_gates() when any component is on CUDA. Measured at 50 steps (native modules, decoder on CPU, RTX 5060 Ti 16 GB), warm generation: SDXL 1024x1024: 234 -> 100 s (R gc 209 -> 75 s) SD 2.1 768x768: 101 -> 26 s (R gc 88 -> 15 s) The reduced gc cadence lets the garbage sawtooth ride higher (SD21 peak 5.4 -> 13.3 GB alloc), so smaller cards may need different gate sizing.
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 #24 (needs
.flux_gc_gates()from that branch; will retargetto main when #24 merges).
load_pipeline()now routes through the same allocator gc-gate fix asthe FLUX/Z-Image pipelines whenever any component sits on CUDA. The
legacy SD path had the identical pathology: the torch allocated/reserved
ratio gate is chronically exceeded under backend:native, so R gc fired
on nearly every CUDA allocation.
Measured at 50 steps, warm generation (native modules, decoder on CPU,
RTX 5060 Ti 16 GB):
Notes:
collections (SD21 peak 5.4 -> 13.3 GB alloc on the 16 GB card). The
gate constants are tuned for 16 GB; smaller cards may need different
sizing — measurement tracked separately.
and can OOM on 16 GB regardless of gates (decoder was on CPU for
these measurements). Pre-existing, not changed here.
different (undocumented) component layout and are not restated here.
Full suite 692/692.
🤖 Generated with Claude Code