Repository navigation
feat(sp): refactor ulysses - #352
Merged
tastelikefeet merged 3 commits intoOct 29, 2026
Merged
Conversation
| while isinstance(getattr(root_model, 'module', None), torch.nn.Module): | ||
| root_model = root_model.module | ||
| llm_model = get_llm_model(root_model) | ||
| if not (getattr(llm_model, '_supports_attention_backend', False) or self._is_qwen35_model(llm_model)): |
Collaborator
There was a problem hiding this comment.
_supports_attention_backend 这个兼容性如何
_is_qwen35_model 是否生效面太窄,或者说,太过定制化
Contributor
Author
There was a problem hiding this comment.
_supports_attention_backend 是transformers库内函数,主流模型都支持。_is_qwen35_model 是因为目前linear attn支持sp的补丁只有Qwen3_5GatedDeltaNetUlyssesPatch,所以专门给qwen35开个口子。
Collaborator
There was a problem hiding this comment.
_supports_attention_backend 对旧版本 transformers 的兼容性呢
Contributor
Author
There was a problem hiding this comment.
最低支持这个字段的transformers 版本是4.49
tastelikefeet
approved these changes
Oct 29, 2026
werwrewe
force-pushed
the
sp-slim-20261029
branch
from
October 29, 2026 12:36
7e46ff5 to
73d7150
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.
PR type
PR information
隔离每个模型的 SP 上下文
从Processor当中分离SP strategy
Processor 接收 gather_fn、reduce_fn 两个普通通信回调,不接收或调用 SP strategy。
bug fix
Experiment results
测试环境
硬件/软件:Ascend 910B4;CANN 9.1.0、驱动 25.5.1、Python 3.11.15、PyTorch 2.10.0+cpu / torch_npu 2.10.0、Transformers 5.13.1、base code commit id:f11bd8e
dpo支持实验:



transformers后端回归实验(图1 loss不对齐是base代码中GDN的bug引发,已经修复)
megatron后端回归实验