Perf/flux nvfp4 fusions - #18396
Draft
jhaotingc wants to merge 8 commits into
Draft
Conversation
Signed-off-by: Jhao-Ting Chen <jhaotingc@users.noreply.github.com>
Signed-off-by: Jhao-Ting Chen <jhaotingc@users.noreply.github.com>
Signed-off-by: Jhao-Ting Chen <jhaotingc@users.noreply.github.com>
Signed-off-by: Jhao-Ting Chen <jhaotingc@users.noreply.github.com>
Signed-off-by: Jhao-Ting Chen <jhaotingc@users.noreply.github.com>
Signed-off-by: Jhao-Ting Chen <jhaotingc@users.noreply.github.com>
Signed-off-by: Jhao-Ting Chen <jhaotingc@users.noreply.github.com>
Signed-off-by: Jhao-Ting Chen <jhaotingc@users.noreply.github.com>
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.
Description
This PR improves FLUX.1-dev execution in TensorRT-LLM VisualGen on Blackwell:
TRTLLM_FLUX_FUSED_MLP_GELUaccepts case-insensitivesingle,dual, orfull;1enables both paths and0disables both.qk_dtype: fp8,v_dtype: fp8, block sizes0), using checkpoint quantizer metadata instead of dynamic attention quantization.The changes are API-compatible.
Performance
FLUX.1-dev, NVIDIA B300 SXM6 AC, TP1/Ulysses1/CFG1, CUDA Graph, 2048×2048 output:
The CUTEDSL attention path reduces attention from 122.2 ms to 93.9 ms, including 14.8 ms of current scale/conversion overhead. Separately, sharing activation quantization and enabling both GEMM+GELU fusions reduces 512×512 NVFP4 step latency from 35 ms to 32 ms (8.6%).
The 2048×2048 values sum GPU kernel durations and exclude CPU gaps. The E4M3 attention capture is shape/model matched but used a different physical B300 and NVFP4 MLP tactic, so it is not a strict single-variable A/B.
Test Coverage
pytest -q tests/unittest/_torch/visual_gen/test_flux_transformer.py tests/unittest/_torch/visual_gen/test_model_loader.py— 39 passed.pytest -q tests/unittest/_torch/visual_gen/test_attention_cute_dsl.py -k static_fp8_qkv_forward— 1 passed.pre-commit run -a— passed, including the full mypy check.PR Checklist