- Python 3.10 / 3.11 / 3.12
- Git
- CANN 工具链(Ascend NPU 开发需要)
- CMake ≥ 3.18
git clone https://gitcode.com/mindspore/hyper-parallel.git
cd hyper-parallel采用 origin(fork)+ upstream(主仓库)模式:
# 在 GitCode 上 fork 仓库后
git remote add origin https://gitcode.com/<your-username>/hyper-parallel.git
git remote add upstream https://gitcode.com/mindspore/hyper-parallel.git# MindSpore 后端
python setup.py bdist_wheel
pip install -e .
# 同时构建 PyTorch + MindSpore 后端
BUILD_TORCH_EXTENSION=true pip install -e .pip install pytest pylint markdownlint项目遵循以下代码规范(详见 .agent/rules/code-style.md):
- License:所有
.py文件需包含 Apache 2.0 header(前 16 行) - Style:PEP 8,~120 字符行宽
- Naming:类
PascalCase,函数/变量snake_case,私有_leading_underscore - Docstrings:Google 风格(
Args:、Returns:、Raises:、Example:) - Type hints:公共函数签名必须包含类型提示
- Errors:使用
ValueError配合描述性消息,仅在边界处验证 - Imports:
core/、collectives/、tests/等:模块顶部 importplatform/torch/**、platform/mindspore/**:方法内 lazy import torch/mindspore
- Commits:Conventional Commits 格式(
feat:、fix:、docs:),~80 字符标题,祈使语气 - Branch:功能分支命名
feat/xxx或fix/xxx或docs/xxx - Squash:打开 PR 前压缩 WIP commits
项目配置了 AI Agent skills(.agent/skills/),支持:
| Skill | 用途 |
|---|---|
autogit |
GitCode fork 工作流自动化(commit、PR、status、squash) |
code-review |
分布式正确性、stream sync、内存安全审查 |
dist-op-dev |
分布式算子开发流程 |
platform-dev |
平台抽象层开发 |