Repository navigation
[staging CI] unslothai/unsloth#19957 - #4779
Closed
danielhanchen wants to merge 5 commits into
Closed
danielhanchen wants to merge 5 commits into
danielhanchen wants to merge 5 commits into
Conversation
On an offloaded DiT a batch ran each row through all 42 blocks in turn, so a streamed block uploaded once per row. The layer loop now runs outer and the rows inner: each block is called once with every row, so its offload hook moves the weights once per call, and inside the block each row runs the solo computation at its own text length, mask and RoPE table. The AdaLN modulation also runs at batch 1 (once for a shared timestep), so every row is its own solo render bit for bit instead of carrying a batch-B GEMM's rounding. N=1 keeps the per-sample forward, and UNSLOTH_MOSS_LAYER_MAJOR=0 restores the old order for every batch. Resident, compiled, graphed or otherwise hooked blocks keep the per-sample forward. Concurrent MOSS requests still render one at a time unless the card has a measured verdict in MEASURED_BATCH_WINS (empty by default).
Measured on an A100-SXM4-80GB with the DiT streamed by block-level group offload (bf16 eager, 1024 px, 10 steps, 3 ABBA repeats): one layer-major call for N=2 runs 1.98x and for N=4 2.42x faster than N serial renders (95% CI lower bounds 1.98x and 2.40x), with block uploads per step dropping from 336 to 84 at N=4. Every batched latent equals its own solo render (G2c n=24, upper bound 0.0; row 0 identical at N=2 and N=4), so this card gets a serving verdict. Resident loads measured 0.997x and keep rendering one at a time.
…port coalesce_prompt_key imported diffusion_moss_image (which needs diffusers at import) outside the try, so a backend without diffusers raised from the key instead of rendering alone. [skip ci]
danielhanchen
force-pushed
the
pr-19957-ci
branch
from
November 27, 2026 12:20
79feb13 to
637d507
Compare
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.
Disposable CI run for unslothai#19957. Do not merge; closed after CI.