MegaMoe Level1 在 CI 的归档测试目录中完成计算和校验后,写入测试证据时执行 git rev-parse HEAD。该目录不含 Git 元数据,命令返回 128,导致 rank 0 退出失败。
git rev-parse HEAD
受影响的两个场景为共享资源验证和原默认接口验证;其余 rank 已通过。公共证据采集位于 tests/torch/multicore/_mega_moe_utils.py。
tests/torch/multicore/_mega_moe_utils.py
最小复现:
import subprocess import tempfile with tempfile.TemporaryDirectory() as root: subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=root, text=True)
错误包含 fatal: not a git repository,并抛出 subprocess.CalledProcessError,退出码为 128。在 Git worktree 内执行时能够获取 SHA,因此通常不会触发该问题。
fatal: not a git repository
subprocess.CalledProcessError
源码 SHA 应作为可降级的辅助证据。没有 Git 仓库或 Git 不可用时,记录 source_sha: null 和失败原因,继续保留版本、文件哈希及各 rank 的验证结果。正常仓库仍应记录实际 SHA,其他证据采集错误和测试断言应正常报告。
source_sha: null
修复 PR:https://gitcode.com/mindspore/hyper-parallel/pull/1368
已使用真实 Git 命令复现原错误,并在模拟设备信息及 2/4 rank 汇总的证据写入回归中验证降级行为;这项回归不代表重新执行了 NPU ST。
🐛 Describe the bug
MegaMoe Level1 在 CI 的归档测试目录中完成计算和校验后,写入测试证据时执行
git rev-parse HEAD。该目录不含 Git 元数据,命令返回 128,导致 rank 0 退出失败。受影响的两个场景为共享资源验证和原默认接口验证;其余 rank 已通过。公共证据采集位于
tests/torch/multicore/_mega_moe_utils.py。最小复现:
import subprocess import tempfile with tempfile.TemporaryDirectory() as root: subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=root, text=True)错误包含
fatal: not a git repository,并抛出subprocess.CalledProcessError,退出码为 128。在 Git worktree 内执行时能够获取 SHA,因此通常不会触发该问题。Expected behavior
源码 SHA 应作为可降级的辅助证据。没有 Git 仓库或 Git 不可用时,记录
source_sha: null和失败原因,继续保留版本、文件哈希及各 rank 的验证结果。正常仓库仍应记录实际 SHA,其他证据采集错误和测试断言应正常报告。Additional context
修复 PR:https://gitcode.com/mindspore/hyper-parallel/pull/1368
已使用真实 Git 命令复现原错误,并在模拟设备信息及 2/4 rank 汇总的证据写入回归中验证降级行为;这项回归不代表重新执行了 NPU ST。
Environment info