Skip to content

Propagate Kimi accuracy-compatible flag to PaddleFleet provider#4747

Open
zrr1999 wants to merge 2 commits into
developfrom
kimi-k2-provider-accuracy-compatible
Open

Propagate Kimi accuracy-compatible flag to PaddleFleet provider#4747
zrr1999 wants to merge 2 commits into
developfrom
kimi-k2-provider-accuracy-compatible

Conversation

@zrr1999

@zrr1999 zrr1999 commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • when KimiK2Provider receives use_accuracy_compatible=True, also set the PaddleFleet internal gpt_model_use_experimental_version flag
  • keeps the public PaddleFormers knob as the single user-facing accuracy gate

Validation

  • python -m py_compile paddleformers/transformers/kimi_k2/modeling.py
  • used in the Kimi reduced-checkpoint alignment workspace together with PaddleFleet accuracy-compatible paths

@risemeup1111 risemeup1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

发现一个需要合入前处理的兼容性问题,已在行级评论中给出具体原因和建议修改。CI 当前还有任务在运行中,未作为本次阻塞依据。

Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

Comment on lines +35 to +39
if getattr(config, "use_accuracy_compatible", False):
# PaddleFleet still uses this internal flag for several
# precision-alignment branches. Keep the public PaddleFormers
# knob as the single user-facing gate.
config.gpt_model_use_experimental_version = True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 优先级:P1

这里直接打开 gpt_model_use_experimental_version 会让 use_accuracy_compatible=True 的 Kimi-K2 在 sequence_parallel=True 时运行到 PaddleFleet 的断言:GPTEmbedding.forward 要求 experimental 版本下不能同时使用 multi_latent_attention 和 sequence parallel,而 Kimi-K2 在建 provider 前固定设置了 multi_latent_attention=True。这会把原本可配置的 TP/SP 训练路径变成首次 forward 才失败。请在映射内部标志前做显式兼容性校验(或补齐 PaddleFleet 支持),避免静默构造出必崩配置。

Suggested change
if getattr(config, "use_accuracy_compatible", False):
# PaddleFleet still uses this internal flag for several
# precision-alignment branches. Keep the public PaddleFormers
# knob as the single user-facing gate.
config.gpt_model_use_experimental_version = True
if getattr(config, "use_accuracy_compatible", False):
if getattr(config, "sequence_parallel", False) and getattr(config, "multi_latent_attention", False):
raise ValueError(
"use_accuracy_compatible=True maps to PaddleFleet gpt_model_use_experimental_version, "
"which does not support Kimi-K2 MLA with sequence_parallel=True."
)
# PaddleFleet still uses this internal flag for several
# precision-alignment branches. Keep the public PaddleFormers
# knob as the single user-facing gate.
config.gpt_model_use_experimental_version = True

@Paddle-CI-Bot

Paddle-CI-Bot commented Jul 7, 2026

Copy link
Copy Markdown

PaddleFormers Log Analysis

Run #28926312817 · Attempt 1

日志分析报告

流水线名称 问题标签 修复建议 日志片段
upload-coverage GitHub API 限流(429) 与本PR无关,runner 在 checkout 阶段触发 GitHub REST API 限流(git 版本 1.8.3.1 过低,强制走 REST API 下载归档),rerun 即可 报错代码

失败的测试case:

upload-coverage / Checkout Code — 三次重试均返回 429 Too Many Requests,job 直接失败

根本原因分析:
runner ernie-cpu-05(yq01-bfs-cs52)上的 git 版本为 1.8.3.1(< 2.18),actions/checkout@v5 无法走本地 git clone,退化为 GitHub REST API 下载压缩包,在并发 CI 场景下触发 GitHub 的 429 限流,与 PR #4747 代码改动无关。

修复建议:

  1. rerun 该 job,限流通常为临时窗口,重跑大概率通过。
  2. 若反复出现,升级 runner 上的 git 到 2.18+,checkout action 将改用本地 git 协议,不再依赖 REST API 下载,从根本上规避 429。

🔍 准确性记录:请点击评论底部 😊 图标,选择 👍(准确)或 👎(有误),将自动记录到 CI 监控系统

🔄 每次 Re-run 后自动更新

@zrr1999

zrr1999 commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Fixed in 640095a: when use_accuracy_compatible=True is combined with sequence_parallel=True and Kimi MLA, KimiK2Provider.__post_init__ now raises a ValueError before mapping to PaddleFleet gpt_model_use_experimental_version, instead of constructing a config that only fails later in forward.

@risemeup1111 risemeup1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复查了新提交,之前关于 use_accuracy_compatible=True 与 Kimi-K2 MLA/sequence parallel 组合的 P1 兼容性问题已经通过显式 ValueError 校验修复。当前代码改动对我来说可以接受。

CI 仍有任务在运行中,请以最终 CI 结果为准。

Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

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.

3 participants