Repository navigation
[Diffusion][FLUX.2] Fuse eager AdaLN and packed SwiGLU - #34616
Merged
Merged
Conversation
BBuf
requested review from
AgainstEntropy,
HaiShaw,
mickqian,
ping1jing2,
yichiche and
yingluosanqian
as code owners
August 12, 2026 18:38
BBuf
force-pushed
the
bbuf/b300-flux2-eager-fusions
branch
from
August 13, 2026 09:39
565b96d to
8fec087
Compare
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 16, 2026
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
Sep 10, 2026
This was referenced Sep 20, 2026
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.
Summary
Speed up FLUX.2 eager inference with two bit-exact fusions:
Both paths retain the original expressions for
torch.compile. The eager fast paths use per-signature first-use verification and fall back safely when layout, dtype or capture state is unsupported. The cleanup also makes two correctness constraints explicit:B300 performance
FLUX.2 Klein Base, 1024x1024, seed 42, 50 steps, native backend,
quality=lossless:torch.compilewith both PRsWith both FLUX.2 PRs, eager is 0.83% faster than compile in denoise; E2E is within 0.57% in this single-request measurement.
Measured against main
dbebc1deb42b00befa3d0de67265d7003994c1ad. The B300 validation tree is identical to this PR's final Git tree.Output comparison
The before/after images use the same prompt, seed, resolution and step count. The generated PNGs are pixel-exact and have the same SHA-256 (
6a103716dd891a301409e51bc6bd6dee2d6fb997fee21bfe0785fd504d6a5a39).Validation
5 passedCI States
Latest PR Test (Base): ❌ Run #31687601642
Latest PR Test (Extra): ✅ Run #31692846540