feat(npu): Ascend platform, Ulysses SP, long-context attention, and fused DiT ops for v1 - #270
Open
Chitandaaaaa wants to merge 5 commits into
Open
feat(npu): Ascend platform, Ulysses SP, long-context attention, and fused DiT ops for v1#270Chitandaaaaa wants to merge 5 commits into
Chitandaaaaa wants to merge 5 commits into
Conversation
Add platforms registry with Ascend capability probes, extend utils/platform for npu/hccl/compile kwargs, and register a MindIE attention backend for Qwen-Image on the v1 layout. Co-authored-by: Cursor <cursoragent@cursor.com>
Bind Ascend devices before HCCL init_process_group, align/bind config.device across engine workers, and reject MindIE with ring SP. Co-authored-by: Cursor <cursoragent@cursor.com>
Use addcmul for gated residual/modulate micro-opts, and gate MindIE RoPE / layernorm_scale_shift behind USE_MINDIESD_FUSE. Co-authored-by: Cursor <cursoragent@cursor.com>
Chitandaaaaa
force-pushed
the
feat/npu-ulysses4-v1
branch
from
August 13, 2026 04:07
952d369 to
0cf05b6
Compare
under Ulysses SP, hiding all-to-all latency behind FA compute (compute-communication overlap). - Ulysses flow via all_to_all_4D_pre/single/after (SeqAllToAll4D). - FA_ALLTOALL_CUT/OVERLAP count semantics (0/1 off, >1 on, CUT wins): baseline single round trip; cut = head-chunked round trips; overlap = all-to-all on side stream2 overlapped with FA on main stream via npu Event/Stream sync. - current_stream refreshed at forward time. - Ulysses-only; falls back to USPAttention when not available.
…ction - Add Ascend long-context attention under Ulysses SP with a single shared all-to-all comm stream - Add fused RMSNorm and use it in the Qwen-Image transformer - Unify platform abstraction via current_platform - Centralize Ascend tuning knobs (op_fusion, fa_alltoall_overlap/cut) as platform attributes
gaoyuanyuanqiqi
force-pushed
the
feat/npu-ulysses4-v1
branch
from
August 18, 2026 08:04
8a5e54c to
0840a68
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.
Summary
Port Ascend NPU support onto the
v1architecture (capability-level migration from fork PR #11 onmain; not a cherry-pick). CUDA / NCCL paths stay unchanged.platforms/(Ascend capability probes, HCCL, MindIE compile backend), thinutils/platform.pyovercurrent_platform, and register amindieattention backend for Qwen-Image.init_process_group(HCCL), alignconfig.devicein engine/worker, reject MindIE attention whenring > 1.addcmulfor gated residual/modulate; gate MindIE RoPE /layernorm_scale_shift/ fused RMSNorm behindUSE_MINDIESD_FUSE=true.AscendLongContextAttention: SeqAllToAll4D pre/single/after, optional head-chunked all-to-all (FA_ALLTOALL_CUT) or FA/all-to-all overlap on one shared NPU comm stream (FA_ALLTOALL_OVERLAP); falls back to USPAttention when unavailable.op_fusion,fa_alltoall_overlap,fa_alltoall_cutlive onAscendPlatform(env:USE_MINDIESD_FUSE,FA_ALLTOALL_OVERLAP,FA_ALLTOALL_CUT).Commits
bf49ef1feat(npu): add Ascend platform abstraction and MindIE attention8c1e61cfeat(npu): enable Ulysses SP with CFG parallel on Ascend0cf05b6feat(npu): fuse Qwen DiT addcmul, MindIE RoPE, and LN modulate67b93a1Add AscendLongContextAttention: NPU/MindIE long-context attention under Ulysses SP0840a68feat(npu): long-context attention, fused ops, unified platform abstractionNotes
use_torch_compile=False); compile kwargs are injected only when compile is on.USE_MINDIESD_FUSE=truegates MindIE RoPE / LN fuse /npu_rms_norm;addcmulis always on.FA_ALLTOALL_CUT/FA_ALLTOALL_OVERLAP:0/1= off (single round-trip);>1= on. CUT takes precedence over OVERLAP.Test plan
--attn-type mindie(and without).ASCEND_RT_VISIBLE_DEVICES=0,1,2,3, Ulysses SP (sp_ulysses_degree=4,sp_ring_degree=1) + CFG parallel.USE_MINDIESD_FUSE=truefor RoPE / LN / RMSNorm fuse.FA_ALLTOALL_OVERLAP>1orFA_ALLTOALL_CUT>1on 4-card Ulysses.ring > 1is rejected with a clear error.