Draft
[WIP] feat(npu): add deterministic canonical owner geometry #25
[WIP] feat(npu): add deterministic canonical owner geometry #25
Draft
Jia_AustinAdd on 1 day ago
Jia_Austin
Jia_Austin
1 day ago

当前 PR 是否有 AI 参与

  1. AI Agent 平台:OpenAI Codex
  2. AI 模型:GPT-6
  3. Prompt 上下文摘要:为 MindSpeed/MoonEP 确定性训练实现原生规范梯度行映射,保持动态迁移与原数学顺序;要求独立审查、真机验证,并明确区分组件证据与整模型验收。

问题与实现

MoonEP动态迁移会改变物理行序。核心提交 8e5b11fef8054b3833842f3882d9d30adbcb8ac5 在Provider原生planning后生成规范owner行映射,替代生产路径的完整路由D2H和CPU排序;新增generation绑定的preflight/metadata/rows/send/audit及Prepare/Submitted/Ready/Retire协议。保留动态bank迁移、BF16逐路由舍入、FP32输入梯度Combine、原实际形状sum及逐专家addmm_。未知提交/完成错误保根、关闭准入,不重发或隐式回退。

范围与配套

来源:Jia_Austin/MoonEP-deterministic:feat/moonep-canonical-owner-geometry → Ascend/MoonEP:main。页面比较为25提交、120文件,包含NPU迁移/运行时前置提交及3e88c20、88ca5a5的确定性Combine,不是只有本次几何kernel变更。

配套MindSpeed PR:https://gitcode.com/zhangguobiao/MindSpeed/pull/6 ,接线提交860012fc94dc5392b61d336c049ac3506fe2ce42。

已执行验证及边界

  • Provider控制协议20项CPU测试通过;真实Ascend950构建及实际加载身份核验通过。
  • 单NPU整数机制:18正例、22预期拒绝、414个有效索引张量精确对比通过。
  • 八rank真实planning/通信组件:736个有效索引张量和64组原始BF16/FP32 payload独立复核一致,覆盖强偏斜、空owner、replay、逆序retire及已知Prepare拒绝。
  • 原八rank组件资源验收仍为FAIL:首次退出后全机有占用,后续独立空闲观察不覆盖原FAIL;原PID归属UNKNOWN。

以上仅为组件证据,不构成该候选整模型或性能通过。

已知阻塞:WIP,暂不合并

实际NPU Autograd探针证明forward在主线程、backward在工作线程,均为同一managed default stream。当前永久creator-thread限制不适配真实反向。设计审查仍有P1:逐API互斥未覆盖prefetch→GMM等调用之间的共享bank/arena及geometry借用窗口,需完整exact-plan事务及完成证明。修复尚未包含,不能通过关闭Autograd多线程或直接删除线程检查规避。

整网验收与性能归因

新目标固定八卡BF16 H7168/S8192/E48/K8/GBS64三层mock完整训练图,保留动态迁移。先两次独立OFF15,再OFF1→ON1→ON2→OFF2各15有效更新;四组15/15原始打印loss完全一致,并核对OFF预检一致性。

两臂均开启--manual-gc --manual-gc-interval 50。预热1–5步、统计6–15步,每步取八rank整数纳秒最大值,每臂20样本;nearest-rank p95取第19个。ON/OFF mean与p95均须≤1.20;正式窗口无分项计时探针,最终参数/梯度采样在第15步显式计时结束后执行。

本PR候选完整模型数值、整步性能及新15步验收:NOT_RUN。

历史阶段一筛查OFF mean4213.84ms、ON mean6124.51ms,mean比1.4534、p95比1.4475,未达1.20;这不是本次原生候选实测。历史869/910ms CPU区间不能直接从新整步扣除,嵌套控制/同步/搬运/kernel累计不能当作排序自身可移除成本。

后续需修复线程事务并重新冻结源码/native/环境,完成组件与整模型验证,保存原始日志、逐rank计时、实际加载身份、有效更新和资源退出证据,再更新结论。

likedislike
Merge blocked
ascend-robotascend-robotCollaborators
1 day ago Added label: stat/needs-squash
ascend-robotascend-robotCollaborators
1 day ago Added label: ascend-cla/yes
ascend-robot
ascend-robotCollaborators
1 day ago Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.


PR Approval Progress

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
repo-Ascend/MoonEP ❌ (0/2)(You can also ask: 郭鹏, wangjiangben, nino888, 郑加利, lishaoxun) ❌ (0/1)(You can also ask: weixin_49096267, 郑加利, u012145166111, 郭鹏, wangjiangben)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

Jia_Austin, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike