Draft
[WIP] feat(npu): unify URMA PUSH APIs and L+B sync/async prefetch #9
[WIP] feat(npu): unify URMA PUSH APIs and L+B sync/async prefetch #9
Draft
Jia_AustinAdd on Oct 21
Jia_Austin
Oct 21

Owner-pushed URMA weight prefetch retains the continuous-home API and adds the same shared PUT core to canonical expert-pointer sources and L+B synchronous/asynchronous collective paths. The CPU6 integration also fixes deterministic FP32 GradReduce, preserves vector completion, and adds opt-in release batching to reduce host retirement stalls without deleting completion or final-use fences.

This remains a Draft integration. It includes the frozen L+B/async groundwork from MoonEP #10; superseded #11 stays closed. The framework counterpart is MindSpeed #10, based on the frozen #4106 integration. A separate ascend-moonep provider is not required.

Source and review scope

  • Proposed MoonEP head: e41d8444b1f254d9c74803779bd8b26d82f6ef75, an ordinary descendant of this PR's previous f8dbe432b6b8f55e08bd3cbd5e4b6fe9de8256bd.
  • Frozen SHMEM: 2f0695c31944faf8514ee704004384b327ef6746; no mixed SDK libraries or new QP/CQ protocol.
  • Integration ancestry through 8372f675 contains upstream planning, dispatch/combine, async Buffer, and validation changes. Those are dependency alignment, not measured performance improvements in those operators. The CPU6 experiment fixes planning/dispatch/combine to MTE.
  • The independently reviewed optimization/fix increment is 8372f675..e41d8444: 29 files, +1074/-46 lines, including host tests and native ABI checks. It contains ordered FP32 accumulation, kernel-argument alignment, vector completion, independent GR budget, optional AIV prefetch/stream barriers, and release batching.
  • No H5 prefix_before_expert candidate, raw measurement JSON, profiler capture, credential, raw address, or physical handle is added.

API and completion contract

launch_prefetch_push(remote_expert, prefetch_buffers, experts_to_copy, num_sms) retains the continuous-home BF16 source contract. Independent pointer-source prefetch reads canonical expert allocations directly, including non-contiguous/reverse expert storage; no weight staging is introduced. Both use the same URMA core and default SDK PUT queue protocol. Existing GET remains available.

The full [EP,B] plan determines consumer slots. Quiet, collective completion, producer/consumer events, exact-plan lifetime, final use, and poison-on-uncertain-completion remain required. Explicit URMA requests fail closed when the kernel/ABI is unavailable. One process loads one SHMEM runtime.

Defaults remain conservative: Buffer uses MTE unless requested; prefetch and async-stream barriers default to mixed; release mode defaults to serial. async_release_mode='batch' is explicit, rank-agreed and capability-checked, using the existing row/epoch/bank owner and retirement cursor. The stream-AIV variant is available for controlled experiments but is not the CPU6 retained configuration.

CPU6 measured scope

Frozen sources: MoonEP e41d8444, MindSpeed cddbb7dc2805bc777dd72ad8f2f03825b9ca23d1, SHMEM 2f0695c3. Retained config: GR32, prefetch/GR URMA, planning/dispatch/combine MTE, collective completion, prefetch AIV, async stream mixed, release batch, after_prefix, VMM 2m, shared/strict.

Actual model: EP8, TP/PP/CP=1, VPP off, one TransformerLayer, two microbatches, S4096/B1/H7168/FFN3072, E48/K6/L6, BF16 and canonical DDP weights.

  1. Four fresh eight-rank numerical cells used three actual DistributedAdam steps and the original 2094 output/gradient/QKV/updated-parameter/optimizer-state checks. MTE repeat, URMA eager, and URMA after-prefix comparisons had maximum absolute difference 0.0. This is numerical evidence, not optimizer throughput.
  2. H2 release batching passed two complete fixed-weight UT F/B+DDP ABBAs: both candidate p95 values improved approximately 12.95%–13.64% against their own matched serial-release baselines.
  3. H4 after_prefix then passed two complete independent ABBAs with batching held fixed:
ABBA matched baseline p95 threshold candidate B1 p95 candidate B2 p95
screening 144.296160 ms 138.095070 ms 137.194770 ms
independent confirmation 143.660165 ms 138.225540 ms 138.519920 ms

Both candidates' p50 values also met non-regression. These are sequential matched experiments; do not add percentage gains or claim every kernel improved. Local FlashAttention/planning regressions remain in the profile report. GR32→8 was rejected because its matched UT p95 regressed.

Full prefetch timing

EP8 BF16 H7168/FFN3072, FC1 (6144,7168), FC2 (7168,3072), L1/B7; each rank sends 924844032 bytes and receives the same amount. Timing starts before the first FC1 submission and ends after the consumer completes both peer_visible waits, including payload, quiet, necessary collective barriers and waits.

path candidate B1 p95 candidate B2 p95
synchronous 3.029584885 ms 3.037944078 ms
async collective 2.944438934 ms 2.881371021 ms

All four are ≤4.3 ms. Each arm has 10 warmups and 50 measured iterations, uses the slowest rank each iteration and nearest-rank p95 (48th sorted sample). Bandwidth uses one-direction logical bytes, reports GB/s and GiB/s, and applies no extra 0.7 factor. The isolated prefetch probe does not exercise framework GR scheduling; its result is not attributed to H4 scheduling.

Evidence boundary and remaining work

Authoritative external archive: 20261026-cpu6-prefix-gr/H4_STAGE_ACCEPTANCE.json; native identity: 20261026-cpu6-release-batch/evidence/phase3-built-native-v4.json. Exact evidence hashes and paths are recorded in the publication receipt/report. Eight-rank raw results, profile trace/CSV, invalid arms, and failures remain outside the PR.

Registered owners, checked native close/finalize returns, and logical plan/bank closure passed. Independent physical alias/import tracing, multi-layer target-device acceptance, checkpoint/topology expansion, production convergence, and actual optimizer-step performance are NOT_RUN. The framework publication uses a new ordinary merge commit with the exact H4 Git tree; that is a SOURCE/HOST equivalence mapping, not a new device-SHA PASS. H5 remains experimental and excluded. Keep this PR Draft until the explicitly remaining scope is reviewed and accepted.

Immutable evidence index

Archive paths below are relative to the retained local outputs/ archive. The H4 remote archive root on CPU6 (177.2.26.1) is /data/codex-moonep-ordered-cpu6-20261025/phase6-prefix-gr; native build identity is in sibling phase3-release-batch/evidence. These indexes identify external raw evidence; the large measurement/profile files are not committed.

Evidence Archive path SHA256
H4 stage acceptance 20261026-cpu6-prefix-gr/H4_STAGE_ACCEPTANCE.json f9ffe71e850458d4586db70850d319588b7ba0240d5ab158d21ff20727ad2716
UT ABBA screening 20261026-cpu6-prefix-gr/ut-suites/abba/001/comparison.json fed998c4b7744381b74e8cd5a36cd779d5a9d1a1bbbef01410e67971f4d10bfe
UT ABBA independent confirmation 20261026-cpu6-prefix-gr/ut-suites/abba/002/comparison.json 40b17f314bd9d022464e28d6cc2b3d6b66d6e5e3705fb46020bb72e9077e97ee
Sync formula ABBA 20261026-cpu6-prefix-gr/formula-suites/002/sync-comparison.json 2464cb03be7f422aa1dafd6ef07450b9e0f5cb7d7826add155fae2838f38d87a
Async formula ABBA 20261026-cpu6-prefix-gr/formula-suites/002/async-comparison.json f3cb5e8ace7f28242a28a64c4cde2702581150911b8f88a2a9f66ef3395e9da8
Loaded native build identity 20261026-cpu6-release-batch/evidence/phase3-built-native-v4.json 41e15941510c6cebf6430d2cc5cde6a63276bf93bc093885ae01070f1f66003d
H4 profile evidence lock 20261026-cpu6-prefix-gr/analysis/H4_PROFILE_EVIDENCE_LOCK.json cc11466647f3e1e0f8cd387196b118dad1cf1b4a6ca105d8bec12116b169bc28
likedislike
Merge blocked
ascend-robotascend-robotCollaborators
Oct 21 Added label: stat/needs-squash
ascend-robotascend-robotCollaborators
Oct 21 Added label: ascend-cla/yes
ascend-robot
ascend-robotCollaborators
Oct 21 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: u012145166111, zhu-wangyi, 郑加利, lishaoxun, gcw_CXpJWhGA) ❌ (0/1)(You can also ask: u012145166111, 郭鹏, wangjiangben, nino888, lishaoxun)

💡 Tip:

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

CLA Signature Guide

@Jia_Austin , thanks for your pull request.

The following commit(s) have not signed Contributor License Agreement (CLA).

Commit Reason
8372f675 fix: restore original SHMEM depe... the email is not signed for CLA! please check if it is correct and the same as your signed email.

If you need to sign CLA, you can click here to sign the CLA.

If you need to check if the email is set up correctly, you can click here to do it in the FAQs.

After signing the CLA or updating the email, you must comment /check-cla to check the CLA status again.

likedislike
Jia_AustinJia_Austin
Oct 21 Modify description of pull request
9 event messages are collapsed here。 See more
Jia_AustinJia_Austin
Oct 21 Modify description of pull request
szm_thomas
szm_thomasCollaboratorsOct 21Start code review1
npu_patch/native/include/ascend_moonep/kernels/urma_push_core.h
@@ -0,0 +1,0 @@
1+// SPDX-License-Identifier: Apache-2.0
szm_thomas
szm_thomasOct 21Comments:

算子流程逻辑部分,建议和其他代码一样整体放在native/kernels里而非launcher的c++ 头文件中,这里都是host侧的算子调用接口层

另外除了向外提供launcher接口,建议和其他算子一样配置在ops.py中注册,并能够直接通过api.py中的buffer对象向外提供调用接口,实现外部框架接入时的api一致性

likedislike
szm_thomas
szm_thomasCollaboratorsOct 21Start code review1
npu_patch/benchmarks/bench_prefetch_push.py
@@ -0,0 +1,0 @@
1+"""GET/PUSH correctness and full consumer-visible timing; one fresh process per arm."""
szm_thomas
szm_thomasOct 21Comments:

参考bench_vs.py的代码,看在各maxvio情况下,是否性能有提升

likedislike
Jia_AustinJia_Austin
Oct 22 Pushed 30 commits:9145460f-feat(npu): add synchronous L+B Buffer integration,689683aa-feat(npu): migrate collective async-v3 Buffer lifecycle,7774e0e4-fix(npu): import VMM granularity for async preparation,c8c05b27-feat(npu): migrate required-owner prefetch completion,432113a8-refactor(npu): remove historical version suffixes from async SPI,e0117904-feat(npu): add explicit canonical-pointer GradReduce for async reduction,5a162c9e-test(npu): add MTE e2e test matching eight-card validation data volume,f6cc712d-feat(npu): support UDMA for canonical GradReduce targets,e8aa0a7b-feat(npu): add split profiling for UDMA GradReduce,60a2d697-revert(npu): remove UDMA GradReduce split profiling,1df035d3-test: replay sequential UDMA reductions with captured heap layout,dc37e09a-test: add bank and call-order controls to UDMA layout replay,aebf4ee3-test: replay UDMA failures from a selected starting round,fc617d24-test: add original dense GradReduce layout replay,7492d7da-test: add MTE backend controls to GradReduce layout replay,0ebac0d1-Merge validated official URMA PUSH core into L+B integration baseline,3687a241-feat: integrate official URMA pointer PUSH with retained canonical storage,66038326-test: cover detached source metadata and foreign-plan rejection,54b178a9-fix: make collective prefetch engine part of frozen admission,a5760c6e-test: execute fail-closed prefetch admission before allocation,ed98b315-fix: reject unavailable explicit prefetch engines and document official integration,af834eab-fix: validate official runtime identity and formula artifact contracts,14042fd5-test: supply required frozen projection source arguments,cf3ef79b-merge: advance official integration base to PR9 evidence cleanup,5f03425c-merge: synchronize frozen official PR9 and PR10 baseline,8293b5f8-fix: separate asynchronous PUSH local source count from consumer slots,02d3a5a0-Add validated local-home URMA PUSH binding for L+B,bd3c53c6-Expose independent tensor-pointer URMA PUSH with transfer lifetime protection,371b53b3-Merge commit 'bd3c53c' into codex/contiguous-first-20261021,d26a4369-Delegate L+B sync and async URMA prefetch to standalone PUSH operations
9 event messages are collapsed here。 See more
Jia_AustinJia_Austin
Oct 26 Modify description of pull request