[DSV4] Fix Muon slice config empty layer offset#4758
Conversation
risemeup1111
left a comment
There was a problem hiding this comment.
已完成初轮审查。代码语义上新增的 empty layer 偏移和 DSV4 checkpoint 映射方向一致;当前需要阻塞的是 Lint 已失败,具体修复点已放在行级评论中。
| num_empty_layers_add_in_head = getattr( | ||
| config, "num_empty_layers_add_in_head", 0 | ||
| ) or 0 |
There was a problem hiding this comment.
问题: 当前新增的换行格式没有通过项目的 black 校验,PR 的 Lint check 已经失败,合入前必须修复。
证据/影响: CI 日志显示 black 对 paddleformers/transformers/deepseek_v4/modeling.py 执行了 reformat;我用 .pre-commit-config.yaml 中固定的 black 22.8.0 复核,唯一 diff 是这里三行需要折叠为一行。若不修复,必需 CI 会继续失败。
期望处理: 请按 black 输出格式更新该赋值行,然后重新推送 commit。
处理要求:请针对该评论修复并提交新的 commit。
| num_empty_layers_add_in_head = getattr( | |
| config, "num_empty_layers_add_in_head", 0 | |
| ) or 0 | |
| num_empty_layers_add_in_head = getattr(config, "num_empty_layers_add_in_head", 0) or 0 |
There was a problem hiding this comment.
PaddleFormers Log Analysis
日志分析报告
失败的测试case: 根本原因分析:
修复建议:
🔄 每次 Re-run 后自动更新 |
eaa39fe to
ae303a5
Compare
risemeup1111
left a comment
There was a problem hiding this comment.
已复查新的提交。上一轮的格式阻塞项仍未完全解决,当前 head 仍会被 black 重排且 Lint 仍失败;我已在原行级线程里补充了当前代码需要的修复形态。
Offset generated DSV4 layer keys by num_empty_layers_add_in_head so Muon slice configs target the physical checkpoint layer ids. Co-authored-by: Codex <codex@openai.com>
ae303a5 to
3a8c78a
Compare
risemeup1111
left a comment
There was a problem hiding this comment.
已复查当前提交,上一轮的格式阻塞项已经修复:black 22.8.0 本地校验通过,CI Lint 也已通过。当前改动看起来可以接受,剩余仍在运行的 CI 请以 GitHub Checks 结果为准。
Description
model.layers.*配置项时计入num_empty_layers_add_in_head。compress_ratios及其他逐层配置仍使用逻辑层号查询,避免空层偏移影响配置读取。启用头部空层后,checkpoint 中的物理层号与 DSV4 逻辑层号不再一致。原实现生成的 slice config 未计入该偏移,可能导致 checkpoint 加载后使用错误的 tensor split metadata。