feat(npu): Ascend multi-card Ulysses SP with CFG/FSDP support - #265
Open
Chitandaaaaa wants to merge 2 commits into
Open
feat(npu): Ascend multi-card Ulysses SP with CFG/FSDP support#265Chitandaaaaa wants to merge 2 commits into
Chitandaaaaa wants to merge 2 commits into
Conversation
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
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Chitandaaaaa
force-pushed
the
feat/npu-ulysses4-main
branch
from
July 30, 2026 09:35
ff5e2d5 to
c3e278d
Compare
Chitandaaaaa
force-pushed
the
feat/npu-ulysses4-main
branch
2 times, most recently
from
July 30, 2026 12:38
e5a0f9e to
4a9cd33
Compare
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
force-pushed
the
feat/npu-ulysses4-main
branch
from
July 31, 2026 01:50
4a9cd33 to
ef35998
Compare
blian6
reviewed
Jul 31, 2026
| for cfg_ranks in cfg_groups: | ||
| group = dist.new_group(cfg_ranks) | ||
| if rank in cfg_ranks: | ||
| PROCESS_GROUP.CFG_GROUP = dist.new_group(cfg_ranks) |
Author
There was a problem hiding this comment.
每个 rank 都按相同顺序 new_group,再决定是否赋值给 PROCESS_GROUP。这是 PyTorch 官方对 torch.distributed.new_group 的硬性约定,不是 HCCL 单独发明的规则。
出处:torch.distributed.new_group
原文:
This function requires that all processes in the main group (i.e. all processes that are part of the distributed job) enter this function, even if they are not going to be members of the group. Additionally, groups should be created in the same order in all processes.
HCCL 对此更严格。
| device_mesh: DeviceMesh, | ||
| parallelize_plan: Optional[Union[ParallelStyle, Dict[str, ParallelStyle]]] = None, | ||
| ): | ||
| # TP relies on a private torch API removed in PyTorch >= 2.9; adapt separately later. |
Author
There was a problem hiding this comment.
高版本目前没有可以替代的方法,目前只是校验,高版本把该私有方法合并了,暂时没有暴露类似的api,暂时规避,后续是否可以考虑删除。
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
ParallelWrapperon NPU (HCCL).SeqAllToAll+ MindIE attention (attn_impl=mindie/ auto on NPU).dist.new_group(required by HCCL).ring_degree > 1is still unsupported on NPU.