[NPU] [Diffusion] Support MiniMax H3 on Ascend NPU's - #33569
Merged
ping1jing2 merged 137 commits intoAug 25, 2026
Merged
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
OrangeRedeng
force-pushed
the
minimax-h3-on-npu-support
branch
from
August 4, 2026 15:47
d537de8 to
6f0837a
Compare
ping1jing2
reviewed
Aug 5, 2026
…er paltforms, switch to current_platform workflow, fix lint
OrangeRedeng
marked this pull request as ready for review
August 5, 2026 14:25
…moved the cross-platform capability hook. Restored the complete minimax_h3_t2va_2npu baseline exactly from b828184. NPU/MUSA baseline diagnostics and generation now target their overlay files.
… Layerwise offload still calls empty_cache() on NPU
Collaborator
Author
|
/rerun-failed-ci |
Removed information about performance mode and torch compile for MiniMax-H3.
Collaborator
Author
|
/rerun-failed-ci |
Collaborator
Author
CI failure analysis
Conclusion: no PR-related CI failures. |
ping1jing2
approved these changes
Aug 25, 2026
This was referenced Aug 26, 2026
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 31, 2026
Co-authored-by: ronnie_zheng <zl19940307@163.com>
nzr-niu
pushed a commit
to nzr-niu/sglang
that referenced
this pull request
Sep 1, 2026
Co-authored-by: ronnie_zheng <zl19940307@163.com>
This was referenced Sep 1, 2026
5 tasks
jakki-amd
pushed a commit
to jakki-amd/sglang
that referenced
this pull request
Sep 9, 2026
Co-authored-by: ronnie_zheng <zl19940307@163.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.
Motivation
Extend the native MiniMax-H3 pipeline from #33275 to Ascend NPU, including packed variable-length attention, NPU-safe runtime paths, media dependencies, documentation, and CI coverage.
MiniMax-H3 packs real multimodal tokens together with sequence-parallel alignment padding, so the NPU attention path must keep the real-token and padding segments isolated. The implementation also needs device-generic RNG/autocast/residency handling and safe fallbacks for CUDA/ROCm-specific fused kernels.
Changes
laser_attnwith packed variable-length handling: compute attention only for real tokens, preserve the padded shape, and zero-fill alignment-padding outputs.torch_sdpafor the Qwen3-VL text encoder when the MiniMax-H3 transformer useslaser_attn.SiluAndMulpath and generic fallbacks where CUDA/ROCm fused kernels are unavailable.ffmpeg/ffprobefor MiniMax-H3 media output on Ascend; provide actionable errors/fallbacks for missing runtime dependencies.minimax_h3_t2va_2nputo Ascend CI with performance and consistency checks, refresh the NPU diffusion baselines, and make baseline generation/diagnostics target the platform-specific baseline file.Related work: #33827 adds Cache-DiT support for MiniMax-H3; #33927 tracks the FFmpeg-related output issue; #33366 is the related XPU enablement.
Ascend CI
minimax_h3_t2va_2npuuses 2 NPUs (TP2 + SP1),laser_attn, a resident DiT, layerwise-offloaded text encoder, Cache-DiT, 5-second 1344×768 T2VA generation, 50 inference steps, and seed 1101. Performance and visual consistency checks are enabled against Ascend GT pinned toci-data-diffusion@7df858ead07940ff4d9489230fa9f040dd186789.MiniMax-H3 2-NPU baseline:
e2e=155106.21 ms,avg_denoise=2749.56 ms,median_denoise=613.17 ms.All CI baselines were updated based on the latest results as part of the CI fixing started in #34855
Accuracy Tests
Validated end-to-end 5-second MiniMax-H3 T2VA generation with both Ascend Flash Attention and Laser Attention on 8 Ascend NPUs. Image-conditioned FL2VA was also validated with Laser Attention.
The automated 2-NPU NPU CI case runs both performance and visual consistency checks against the pinned Ascend GT revision.
Server startup:
SGLANG_CACHE_DIT_ENABLED=true \ SGLANG_CACHE_DIT_FN=2 \ SGLANG_CACHE_DIT_BN=1 \ SGLANG_CACHE_DIT_WARMUP=4 \ SGLANG_CACHE_DIT_RDT=0.4 \ SGLANG_CACHE_DIT_MC=4 \ SGLANG_CACHE_DIT_TAYLORSEER=true \ SGLANG_CACHE_DIT_TS_ORDER=2 \ HCCL_BUFFSIZE=256 sglang serve \ --model-path ./weights/MiniMax-H3/ \ --model-type diffusion \ --model-variant fl2va \ --dit-cpu-offload false \ --num-gpus 8 \ --tp-size 2 \ --sp-degree 4 \ --attention-backend laser_attn \ --port 30088 \ --component-residency text_encoder=layerwise-offloadFor a four-NPU host, use TP2 + SP2:
SGLANG_CACHE_DIT_ENABLED=true \ SGLANG_CACHE_DIT_FN=2 \ SGLANG_CACHE_DIT_BN=1 \ SGLANG_CACHE_DIT_WARMUP=4 \ SGLANG_CACHE_DIT_RDT=0.4 \ SGLANG_CACHE_DIT_MC=4 \ SGLANG_CACHE_DIT_TAYLORSEER=true \ SGLANG_CACHE_DIT_TS_ORDER=2 \ HCCL_BUFFSIZE=256 sglang serve \ --model-path ./weights/MiniMax-H3/ \ --model-type diffusion \ --model-variant fl2va \ --dit-cpu-offload false \ --num-gpus 4 \ --tp-size 2 \ --sp-degree 2 \ --attention-backend laser_attn \ --port 30088 \ --component-residency text_encoder=layerwise-offloadUse
--attention-backend fato validate the Ascend Flash Attention path.T2VA request:
Result:
78894a1d-fc7c-46c6-92a5-d2e87ad5062a.mp4
FL2VA request:
Forest.jpg
Result:
47d01bb6-3f72-4130-8623-0e309d987b08.mp4
Speed Tests and Profiling
Laser Attention computes only the real-token segment and zero-fills alignment-padding outputs, avoiding work on the padding segment while preserving packed-sequence semantics.
FA vs Laser Attention on the manually measured T2VA workload:
CACHE-DiT on the manually measured T2VA workload:
The manual measurements use the same 5-second T2VA request at 1344×768, 124 frames, 24 FPS, 50 inference steps, and seed 1101. The launch commands list the measured Cache-DiT configuration explicitly:
FN=2,BN=1,WARMUP=4,RDT=0.4,MC=4, TaylorSeer enabled, and TaylorSeer order 2. They also pass--dit-cpu-offload falseso the transformer remains resident on the NPUs and--component-residency text_encoder=layerwise-offloadto avoid keeping the full text encoder resident on every device.The automated 2-NPU CI performance baseline is:
This CI baseline is used for regression detection and is kept separate from the manual 4/8-NPU topology comparison.
Laser Attention performance:
T2VA:

FL2VA:

Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci.CI States
Latest PR Test (Base): ✅ Run #32739983138
Latest PR Test (Extra): ❌ Run #32739982111
Latest PR Test (AMD ROCm 7.2): ❌ Run #32739982696