TensorPlay AI
打开导航

贡献 TensorPlay

从一个可复现问题开始,让每次改动都保持清晰、可测试、可讨论。

合入你的第一个改动

  1. 01
    Fork 并克隆

    Fork 仓库后克隆到本地。

    git clone https://github.com/<you>/TensorPlay.git
    cd TensorPlay
  2. 02
    建分支

    一个分支一个主题,评审最快。

    git checkout -b feat/my-change
  3. 03
    安装并构建

    PEP 517 构建(scikit-build-core);MAX_JOBS 限制并行度。

    pip install -e .
  4. 04
    跑测试

    pytest 必须通过;不稳定测试打 kind/flaky 标签,而不是悄悄重跑。

    pytest test/
01

Conventional Commits

由 tools/commit_schema.py 强制(commit-msg 钩子 + PR 标题检查)。PR 标题会成为 squash 提交主题。

  • type(scope): subject —— 标题 ≤ 100 字符,结尾不加句号
  • feat/fix 必须带 scope;scope 与 release notes 标签一一对应
  • 破坏性变更:标题加 !,footer 写 BREAKING CHANGE:
02

Scope 一览

按改动落点选择 scope;release notes 依据它自动归类。

  • frontend — Python API、Tensor、绑定
  • autograd — TPX 引擎、前向微分
  • compiler — tensorplay.compile、Stax、Triton
  • kernels — p10 核心库、CPU 内核
  • cuda — 运行时、流、图、分配器
  • build / docs —— 打包、CI、文档
03

代码风格

Python 带类型标注并用 black 格式化;C++ 遵循 Google 风格,用 clang-format。

  • Python:PEP 8 + 类型标注 + black
  • C++:Google C++ 风格 + clang-format
  • pre-commit:pip install pre-commit && pre-commit install --hook-type pre-commit --hook-type commit-msg
04

Triage 与标签

新 Issue 和 PR 进入 needs-triage 并自动上项目板;milestone 按发布分桶。

  • kind/flaky —— 间歇性测试或构建失败
  • breaking change —— 必须写入 release notes
  • regression / performance / platform: linux|macos|windows

贡献入口

Ask DeepWiki