mindspore-ai / mindspore-ai/hyper-parallel

[Bug]: MegaMoe Level1 在无 Git 元数据的 CI 目录中写入证据失败

Open
#615 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
53
Forks
63
Avg merge
23h 45m
Merged PRs (30d)
63

Description

🐛 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
  • CI:Ascend910B,测试从不含 Git 元数据的归档目录运行。
  • 本地最小复现:cann920 环境中的 Python 3.10.19。

schema_version: 1
source: gitcode
gitcode_repo: mindspore/hyper-parallel
gitcode_issue: 375
source_url: https://gitcode.com/mindspore/hyper-parallel/issues/375

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tests/torch/multicore/_mega_moe_utils.py and review the evidence-collection path that runs git rev-parse HEAD. Reproduce it from a Git-free temporary directory, then run the evidence-writing regression covering simulated device information and 2/4-rank aggregation; done means missing Git records source_sha as null with the failure reason while preserving other evidence and normal SHA capture.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.