Repository navigation
Studio MiniMax-H3-Image: the streamed int8 GEMM route also installs the fused SwiGLU - #18798
Merged
Merged
Conversation
…sed SwiGLU too The fused SwiGLU installed only when the levers held the exact string h3_int8_gemm, so the streamed tier (24 GB cards, h3_int8_gemm_streamed) ran every MLP on the stock forward: value * silu(gate) materialised, then its own rotation and act quant before the down projection. The pinned streamer keeps the swapped Linears and copies into their parameters, and producer_linear already takes the stock path for any call whose weight is not on the card, so the streamed route now installs it as the resident tiers do. UNSLOTH_H3_FUSED_SWIGLU=0 keeps the stock MLP.
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
On the MiniMax-H3-Image streamed tier, every MLP ran the stock forward. This is the tier 24 GB cards get (L4, 3090, a capped Ada).
_installindiffusion_minimax_h3_image_speed.pyinstalled the fused SwiGLU only when the levers held the exact string"h3_int8_gemm", but the streamed route records"h3_int8_gemm_streamed". So on those cardsvalue * silu(gate)was written out in bf16, then rotated and quantised again for the down projection, in every block and every step. The resident tiers have fused this since #18090 / #18284.Change
int8_gemm_routealready requires before it picks the streamed GEMM.producer_linearreturnsNone, which falls back to the stock MLP, for any call whose weight is not on the card._readyfalls back as well whenever the SwiGLU module or the down Linear has a hook. The input projection still runs its own forward, so its hooks are kept.UNSLOTH_H3_FUSED_SWIGLU=0keeps the stock MLP, as before.Tests
test_the_fused_swiglu_installs_on_every_int8_gemm_route(CPU, 5 cases): pinned streamed installs it, resident installs it,UNSLOTH_H3_FUSED_SWIGLU=0,UNSLOTH_H3_IMAGE_INT8_GEMM_STREAMED=0and the pageable streamer do not.test_differential.py: DISCRIMINATING, no head failures).tests/test_diffusion_minimax_h3_image_speed.py,tests/test_h3_fused_swiglu.py,tests/test_h3_image_resident_route.py: 62 passed.GPU (Colab L4, 22.5 GB: the streamed tier)
H3-Image at 1024x1024, 6 steps,
streamedplacement. Main and this branch ran in fresh processes on one VM, sharing one Studio home, with 2 warm-up cells and then 3 interleaved reps per arm. The batch ran twice, on two VMs, after an infrastructure retry.Medians of 9 steady renders per arm.
torch.equalon all 4 prompts on both VMs. Every arm also repeats itself bit for bit.Not proven here