Skip to content

feat(npu): enable multi-card ParallelWrapper on Ascend - #11

Open
Chitandaaaaa wants to merge 3 commits into
mainfrom
feat/npu-ulysses4-main
Open

feat(npu): enable multi-card ParallelWrapper on Ascend#11
Chitandaaaaa wants to merge 3 commits into
mainfrom
feat/npu-ulysses4-main

Conversation

@Chitandaaaaa

Copy link
Copy Markdown
Owner

Summary

  • Add Ascend NPU helpers in utils/platform.py (is_npu_available, HCCL backend, set/sync/empty_cache).
  • Extend ParallelWrapper / _worker_loop with an NPU+HCCL path for multi-card Ulysses SP via built-in mp.spawn.
  • Keep the CUDA+NCCL path unchanged: auto-pick NPU only when CUDA is absent (or when device_type="npu" is explicit).

Test plan

  • GPU machine: existing parallelism>1 path still uses CUDA/NCCL (no behavior change).
  • NPU 4-card smoke: ASCEND_RT_VISIBLE_DEVICES=0,1,2,3 with parallelism=4, sp_ulysses_degree=4, sp_ring_degree=1.
  • Confirm default device="cuda" is rewritten to npu:{rank} inside NPU workers only.

Made with Cursor

1. Add NPU 950 platform abstraction layer with device registry and auto_detect_device
2. Support mindiesd_attention and mindiesd_compile with capability detection and compile_backend
3. Adapt Qwen-Image model to use platform compile kwargs and NPU attention backend
@Chitandaaaaa
Chitandaaaaa force-pushed the feat/npu-ulysses4-main branch 4 times, most recently from e5a0f9e to 4a9cd33 Compare July 30, 2026 12:38
Adapt ParallelWrapper for multi-card Ascend (HCCL/FSDP), route long-context
attention through SeqAllToAll + MindIE, and align config.device at parallel
load entry while workers bind rank-local devices.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chitandaaaaa
Chitandaaaaa force-pushed the feat/npu-ulysses4-main branch from 4a9cd33 to ef35998 Compare July 31, 2026 01:50
Combine addcmul gated residual/modulate micro-opts with MindIE-SD
RMSNorm/RoPE fuse and layernorm_scale_shift under USE_MINDIESD_FUSE.

Co-authored-by: Cursor <cursoragent@cursor.com>
Chitandaaaaa pushed a commit that referenced this pull request Aug 12, 2026
Add platforms abstraction with Ascend capability probes, extend
utils/platform for npu/hccl/compile kwargs, and register a MindIE
attention backend so PR #11 commit1 behavior can land on v1 layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
Chitandaaaaa pushed a commit that referenced this pull request Aug 12, 2026
Port PR #11 commit3 micro-opts onto v1 transformer_qwenimage and
MindIE attention kwargs; MindIE RoPE/LN fuse gated by USE_MINDIESD_FUSE.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant