Repository navigation
Conversation
xuxl1008
requested review from
liuchongming74,
suteng,
yangzhenzhang02 and
yaoyifanx
as code owners
October 31, 2026 08:13
26 tasks
Contributor
Author
|
/retest |
1 similar comment
Contributor
Author
|
/retest |
5 tasks done
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
Gate trigger failed: please fix the /check-pr findings and obtain the |
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
|
@xuxl1008, your gate pipeline failed at the code check stage. You can configure some code check tools locally following the (pre-push quick guide), to enable automatic checking when you push your code every time. Tools included are: Check_CMakelint, Check_Codespell, Check_Cpplint, Check_Lizard, Check_Pylint, Check_ClangFormat, Check_ShellCheck. |
xuxl1008
force-pushed
the
feat/v41-runtime-partial-rope
branch
from
November 2, 2026 14:42
e236def to
ab0dd04
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
|
5 tasks done
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.
Paired: GitHub #1405 ↔ GitCode !1939
问题与改动
本 PR 在已合入 #1250、#1299 的 master 上整理两项改动:修复 V4.1 裁剪模型的 runtime 验收误报,并为 V4.1 增加可选的 partial RoPE 融合前向。
1. 按实际模型结构确定 runtime 验收要求
model_integration.mode: runtime会检查训练中共享状态的发布与消费。原来的 V4.1 描述固定要求 candidate pool 的发布/消费以及 Reindex 对 Index K 的消费;四层裁剪模型关闭 candidate pool 后只有 Full/Reuse,正确的前反向和 optimizer step 也会因这些不存在的角色被判为失败。重计算包装后的 attention/Engram 也可能被模块类型检查误判。SharedStateValidationSpec增加可选的模型级要求解析函数,在执行前根据最终模型配置确定 producer/consumer keys;其他模型的静态描述保持原行为。2. 可选的 partial RoPE 融合前向
V4.1 只旋转每个 head 的尾部通道。原实现会对该切片执行转换、乘加、相邻维度旋转和拼接;大 local Q 下,中间张量读写及 kernel 启动开销较大。
partial_rotary_mul,使用官方cann_ops_transformer.inplace_partial_rotary_mul,按 BSND 存储直接处理尾部 rotary 通道。配置
在 V4.1 attention replacement 中设置,默认关闭,与三类 attention/Indexer/KL 融合入口开关和 Indexer 均衡策略相互独立:
额外依赖为
inplace_partial_rotary_mul原生算子及匹配的 Python 扩展入口。未开启时不加载该可选依赖。runtime 修复不需要开启此开关。精度与验证
none/greedy。在原生确定性 level 1 下运行两步 AdamW,启用/关闭 RoPE 融合的输出、TopK、全量梯度、更新后参数与优化器状态逐值一致。局部性能
Ascend 910B3,BF16,BSND 主 Q 为
[1, local_Q, 64, 512],旋转尾部 64 维。每种实现预热 2 次、测量 5 次取中位数,包含适配与输出分配;前后向时间包含对应梯度计算。局部前后向额外峰值 allocated 在 8K/16K 分别约增加 4/8 MiB,来自扩展后的旋转系数等适配开销。以上是 RoPE 局部结果,不作为完整 40 层训练 step 的加速比例。
2026-11-02 更新
已 rebase 到 master
4144bb242f1a,保留上游新增的 checkpoint/HF 权重加载测试。门禁构建 #1309 的失败项为测试中循环变量闭包触发的 PylintW0640;已用绑定本轮返回值的 mock 替换该 lambda,没有修改生产计算、容差或禁用检查。相关四个 CPU UT 文件共99项通过;Pylint 3.3.7 使用门禁同源规则和仓库既有过滤规则后无错误。原有 NPU 精度和性能数据的测量范围保持不变,本轮未重新测量 NPU 性能。