Prhub

#29855 [AMD][DI][CI] 3/N Add Kimi K2.6 FP8 MI355X 1P1D nightly recipes

原始 PR 作者 Lzy17 合并时间 2026-07-05 12:05 文件变更 4 提交数 2 评论 3 代码增减 +303 / -22

执行摘要

新增 Kimi K2.6 FP8 MI355X 夜巡配方与 launcher 模型无关改造

PR描述指出,此变更是为了在MI355X夜间测试中增加Kimi K2.6模型的覆盖率,验证 launcher 的模型无关设计,并确保EAGLE3外部draft路径在2节点PD场景下正确工作。所有Kimi特定配置均通过recipe的model:块表达,无需在 launcher 中硬编码。

建议阅读本PR:

  • 关注launcher模型无关设计:通过model:块和可选字段,实现配置与脚本的解耦,值得借鉴。
  • review中关于空hash的修复虽小,但反映了边界条件处理的重要性。
  • MTP准确性不达标的问题需要进一步排查,但基础版已通过,表明主要流程正确。
讨论亮点

核心讨论:

  • resolve_snapshot函数空hash风险:gemini-code-assist[bot] 指出如果 refs/main 为空,函数会错误返回 snapshots 目录。已在第二个commit中添加 [[ -n "$hash" ]] 检查修复。
  • HaiShaw要求最小化对process_result.py的改动:最终未修改该文件,符合要求。

实现拆解

实现分为三个步骤:

  1. launcher 重构scripts/ci/slurm/launch_mi355x.sh):将HF缓存快照解析提取为resolve_snapshot函数,供 MODEL_PATH 和外部draft路径共用。新增可选字段支持:split attention(prefill_attention_backend/decode_attention_backend)、SWA比例、model:块(环境变量+服务参数)、外部draft模型路径。当字段为空时自动跳过对应标志,确保DSV4原始配方生成完全相同的 docker run 命令。
  2. 新增 Kimi 配方文件recipes/mi355x-fp8/kimik26/1k1k/1p1d.yaml1p1d-mtp.yaml):前者为基础配方,后者增加EAGLE3 MTP块。两个配方均自包含,没有继承。包含 model: 块(设置 SGLANG_USE_AITERSGLANG_ROCM_FUSED_DECODE_MLAenable_multithread_loadkimi_k2 解析器等)、split attention后端(aiter+triton)、GSM8K准确性门控(>0.92)。
  3. 注册夜巡配置scripts/ci/slurm/nightly-configs.yaml):添加 kimik26-fp8-mi355x-sglangkimik26-fp8-mi355x-mtp-sglang 两个配置块,指向对应recipe文件,指定模型路径、精度、并发搜索范围等。

测试方面:PR描述中已在实际MI355X硬件上验证了Kimi基础版(GSM8K 0.941)和MTP版(0.948)的正确性。DSV4的docker run命令与旧脚本字节一致。Issue评论显示了一次运行中MTP版准确性不达标(0.892 < 0.92),但基础版通过,表明可能需要进一步调试。

文件 模块 状态 重要度
scripts/ci/slurm/launch_mi355x.sh CI 脚本 modified 6.37
scripts/ci/slurm/recipes/mi355x-fp8/kimik26/1k1k/1p1d-mtp.yaml CI 配置 added 5.26
scripts/ci/slurm/recipes/mi355x-fp8/kimik26/1k1k/1p1d.yaml CI 配置 added 5.19
scripts/ci/slurm/nightly-configs.yaml CI 配置 modified 4.37

关键符号

resolve_snapshot

关键源码片段

scripts/ci/slurm/launch_mi355x.sh infrastructure

核心 launcher 改造,添加模型无关支持

# Resolve a HuggingFace cache dir (models--org--name) to its live snapshot dir.
# Lets nightly-configs / recipes point at the shared cache without hardcoding a
# snapshot hash; a concrete snapshot dir (or plain dir) is returned unchanged.
# Used for both MODEL_PATH and an optional speculative draft model path.
resolve_snapshot() {
  local p="$1"
  if [[ -f "$p/refs/main" && -d "$p/snapshots" ]]; then
    local hash resolved
    hash="$(cat "$p/refs/main")"
    resolved="$p/snapshots/$hash"
    # Guard against empty hash — the gemini-code-assist[bot] review caught this
    if [[ -n "$hash" && -d "$resolved" ]]; then
      echo "resolved snapshot: $p -> $resolved" >&2
      echo "$resolved"
      return 0
    fi
    echo "ERROR: refs/main=$hash but $resolved missing" >&2
    return 1
  fi
  echo "$p"
}MODEL_PATH="$(resolve_snapshot "$MODEL_PATH")" || exit 1# In the recipe parsing Python snippet, emit handles optional fields:
# emit("ATTN", rt.get("attention_backend", ""))
# emit("PATTN", rt.get("prefill_attention_backend", ""))
# emit("DATTN", rt.get("decode_attention_backend", ""))
# emit("SWA", rt.get("swa_full_tokens_ratio", ""))
# emit("HAS_MODEL", 1 if r.get("model") else 0)
# ...

评论区精华

resolve_snapshot 函数空 hash 风险 正确性

gemini-code-assist[bot] 指出当 refs/main 为空时,函数会错误返回 snapshots 目录,因为 -d 检查会通过。建议增加 `-n "$hash"` 检查。

结论:已在第二个 commit 中添加 `if [[ -n "$hash" && -d "$resolved" ]]` 修复。 · 已解决

最小化 process_result.py 改动 设计

HaiShaw 要求最小化对 process_result.py 的改动。此 PR 最终未修改该文件。

结论:未修改 process_result.py,符合要求。 · 已解决

风险与影响

技术风险:

  • launcher新增字段可能影响现有DSV4配方。但PR已通过逐字节对比确认DSV4的docker run命令不变,风险较低。
  • 外部draft模型路径依赖于/it-share挂载,路径有效性需运行时保证。
  • split attention后端(aiter/triton)可能引入Kimi模型特定的兼容性问题。
  • MTP配方在一次CI运行中准确性不达标(0.892 < 0.92),可能存在模型或配置问题,需跟踪。

影响范围:

  • 仅影响MI355X硬件上的夜间测试,增加两个新配置。不对现有DSV4或其他平台产生影响。
  • launcher的扩展性增强,为未来添加其他新模型(如LFM等)提供路径。
  • 团队将获得Kimi K2.6在2节点PD场景下的性能与准确性基准数据。
边界条件修复 配置兼容性 外部依赖路径

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论