Closed
[WIP]Draft: feat(moe): bind prepared MoonEP targets through local runtime nodes #4142
Jia_AustinAdd on 24 days agoClosed at 23 days ago
[WIP]Draft: feat(moe): bind prepared MoonEP targets through local runtime nodes #4142
Closed
Jia_AustinAdd on 24 days agoClosed at 23 days ago
Jia_Austin
Jia_AustinCollaborators
24 days ago

Resulting behavior

Integrate ordinary MoE runtime experts with original MoonEP prepared L+B bindings and discrete gradient targets. MindSpeed-local BasicOperation nodes reuse unchanged TENPU Sequential/OperationFuser/OperationContext; canonical Parameter/main_grad/optimizer/checkpoint remain owned by the original model. No second Experts.backward, remote model parameters, TENPU namespace injection or home mirror.

Production remains default-off. The complete training gate remains fail-closed and the component-driver registry is empty. This Draft does not claim full native qualification, training acceptance or performance.

Fixed dependencies and computation

  • Unmodified TENPU f3ce68ba3244720ead26a25d5b388c38293b730c; task source changes0. Historical #367 is not a merge dependency.
  • Unmodified MoonEP #19 72b8e69a43cd13b3ddbea095620af35c77c6e4d1, approved base dev_server_dedup@d8b9db58ca13e2e8545575034f8f57b956fee342. Historical #18 is not loaded alongside it.
  • Actual PR19 submodules: SHMEM 2f0695c31944faf8514ee704004384b327ef6746, CATLASS 4fab1d0953b846f4876aa04cf07d1ecbd1110fad.
  • Forward/dgrad: one token Tensor, G two-dimensional home/slot weight refs, one caller-owned output. Wgrad: two BF16 inputs, independent FP32 full-G scratch; actual local canonical targets and remote slots each add once, then original GR adds remote contributions directly to canonical targets. No post-GR canonical add.
  • Existing standard V5/AddV2/ReduceSum only; no PR12033, new GEMM/GR core, per-expert Python GEMM, hidden weight packing or result copyback. Original Buffer owns physical resources/failure; full registration precedes one SHMEM init. Exact-plan R1/source pin, raw-version and original DDP handoff remain required.

Current caller-thread correction

Current head f2941f9f6703be8053f321884e241c1e20516f07: 241 guarded HOST contracts PASS, with162 source-matched targeted tests; final receipt fea1bfe42ea47feb260a10a73ef33708e86e016ddfab7a9afa2ba24acd662191. Nine existing files,429added/58deleted; independent review section64 has no remaining P0/P1 in this scope. Original owner-state/configuration AST, C++, setup, capability constants and training gate remain unchanged.

A fresh original-Core/DDP component at reviewed parent8469 failed before backward payload. Both ranks' exact refusal notes show a different Autograd OS thread, while device/stream match and the upper binding/version checks passed. Current/live/source diagnostics and capacity margin are normal; the later owner checks were not executed after the early thread refusal. Raw log af98e7efce40e4078c9ac72e9614ba4d4b995732b8ba6959c4ad296a0442079c and both failed attempts remain preserved.

The correction uses an enabled-only MindSpeed feature wrapper around the original Core schedules.backward_step, scoped to original Torch set_multithreading_enabled(False). It retains the configured thread guard and restores scope through the original API; no executor, worker handoff, manager or second backward mathematics is added. Early backward/handoff failures enter the existing Buffer poison/retention boundary. OFF does not register the patch.

The component uses that same wrapper with the actual Core function. Its matrix output was never pseudo-deallocated by the old direct-Autograd fixture; it now explicitly declares deallocation=false at fixture construction, leaving shapes/dY/math/tolerances unchanged. Production config/custom-backward behavior is untouched and the PP/pseudo-deallocation branch remains NOT_RUN. Fixed Torch Python source/ac56, three compiled method-code identities and both original torch._C builtin owners are audited separately from the exact installation lock. Thread/TLS observations reject missing events, foreign threads or TLS=true. Outside-scope restoration is source/host supported, not separately claimed as an actual sampled runtime value.

New private Linux staging at this head compared all three native build inputs and explicitly reused unchanged binaryd19. Its actual-installation collection exited0 and retained the actual/declaration mismatch, macro0 and empty registry. A fresh two-rank ordinary Core/DDP component then exited0: each rank completed four exact calls (two microbatches × two batches); all eight backward-entry/return observations per rank have actual thread=configuration and TLS=false. Conditioned local mathematics/publication/transport and real no_sync/exactly-once DDP readiness checks pass. Rank receipts: ab4739d2ddea984f6df5982fb52d28714cd217df4fcedd5bc27a19b1db7d5225, 421d208ee289c64ad5965b6e91ba3fab55a98e62587cbd178228c7c5159b1ed2; raw log aed52c63344987c43f96d4200df62716190844c4232cd920ef1c772521a3ff8c. Independent review section66 confirms this bounded result.

The fixture covers zero expert groups and rank1 inactive→active twice. Self-slot is NOT_EXERCISED, EP2 has at most one remote contributor, and several GR counterfactuals have zero/low numerical signal. Their numerical equality alone does not exclude missing/double contributions. Rank0 probability cast discrimination is partially NOT_EXERCISED; rank1 passes, both match the FP32 path. Diagnostic D2H synchronization leaves Q1/peer-final-use UNKNOWN, native init-call count remains UNKNOWN, and production feature/custom-backward/PP topology acceptance is not inherited. Full S2 is still UNKNOWN_NOT_REGISTERED; training/performance remain NOT_RUN. Collector and component PLOG windows respectively contain2/5 files with0 observed ERROR; this is supplemental evidence only.

Prior reviewed source and real OFF bootstrap discovery

Prior reviewed head a110ace11310b2f85f0dad86798885bb46dc8506: 226 guarded HOST contracts PASS, including59 targeted observer tests. Receipt c77a9985a3c663e7da97fdcc120b6f17868808130dedca46e920304adf4215ea; independent review finds no remaining P0/P1 in the two-file increment,285added/49deleted. Product mathematics, C++, gate and dependencies are unchanged.

A real fresh OFF discovery exposed a tooling gap: original MA successfully auto-imported MS, but the existing audit rejected Python's legitimate super() class closure. The correction accepts only exact framework namespaces and proven declaring class/member plus actual static binding or applied original registry anchor, including an original class retained by a registry after global replacement. Unknown/aliased/arbitrary classes remain refused; no constructor/getter is invoked. Generic Python code-content hash now explicitly uses marshal-v2 rather than reference-count-sensitive default sharing markers. No source or mathematical threshold is weakened; old representations do not inherit new qualification.

A fresh source-matched retry completed normally: OFF_DISCOVERY_ONLY PASS, receipt 79c3d9772e7ab2cfa8351c6c878d70d38404ef741209b1c11371db0e526611f0. Original MA auto-bootstrap,13 actual target graphs, five before/after source snapshots and selected Torch artifacts match their fixed locks; MoonEP feature flags remain false/false, observed CUDA/NPU initialization flags false. Independent review matched18 actual graph source files,26 marshal-v2 Python nodes and4 legitimate class-cell declarations. One PLOG file had no observed ERROR. This is not ON, model construction/DDP, full installation qualification or training evidence. Original bootstrap failure and initial host/hash diagnostics are preserved.

Prior S3 observer source and independent host review

Prior head 901b5a7552bd7620c390b40d5c1f3f819f15550f adds actual-evidence capture in the existing training driver and tests. Iteration0 captures actual canonical/master/optimizer/math settings, scheduler, buffers, RNG and initialized process-group topology before t0. The first original global batch is borrowed without another iterator read, fingerprinted after t1 and released. Warmup1–5 records exact original plan/prepared binding/PUSH/GR/handoff calls and requires positive foreign-slot token counts; steady6–20 adds none of these profiles/readbacks. Python call observation is not native completion evidence; first-batch equality does not prove the complete20-step data sequence.

Three existing files,1675added/9deleted; production mathematics, C++, installation capability constants and training gate are unchanged. 219 guarded HOST contracts PASS, including the stable52-test observer subset and17 affected component tests. Real accelerator imports and dlopen were forbidden. Final receipt SHA256 24b73b9db637f3d7a7fd5c332919af0dabdcd906820b247fd7c1e62ea37f8118, full log 6b28254c1382b96af92da608930164e1ec29ca2d40c8fdbdd3559894563d05a1; independent final review has no remaining P0/P1 in this scope. Git/LF source mapping is recorded.

The first219-test attempt is retained as FAIL: an existing inert Linux-overlay fake encountered Windows path-stat versus FD ctime differences for the same file. Only that Windows host fixture normalizes the simulated ctime before deliberate drift injection; an added ctime-drift negative case preserves rejection. Production mapped-FD checks and thresholds are unchanged. All failed and successful receipts remain available.

The parentd7a55 change and its200 HOST results remain separately recorded: unknown native SHMEM state is rejected before Buffer/arena construction and before init, using only the audited already-loaded exact NOLOAD handle and actual symbol-owner checks. Only integer native0 is accepted; no UID/init/finalize or foreign cleanup is performed by that helper. Native0 is a non-atomic observation, not a reservation/readiness cache.

Matching private native and component results

On177.8.27.1, task-private artifacts were built from original PR19/SHMEM2f/CATLASS4fab without product edits. Static audit 51e15bd1e18759937ec471fa4b669a6c86c41b11014bf14e1ae16810436f4a3e is bounded to its actual files and symbols. _C SHA256 5ccfeaeb289a05d9fa718d2aec5d6b86a81c70d208e9b9d9be948a1a75096a78; SHMEM aa4f73fc0928c73a6dcf230e6bf01fc7f415e9b686fe8afbbc207a92060c016d.

At sourceMSd7a55, fresh cold-load/read-only native-status probe exited0, status0 twice, before/after source and actual loaded-artifact identities equal; no Buffer/UID/init/PG. Receipt 82f6958e93ebd7bc9bddae87b5c9d43c3fbd069a4d75e4baddb0c57420fb36cb.

Original prepared two-rank payload probes also exited0, both ranks payload_checked=true:

  • URMA PUSH, mixed self/remote routing, L=B2/H64/Hp32, sync: summary dad7e98a6839fce9b1758e1638fe522dea3328a0f6d7ea658d788dce1a27a6ad.
  • URMA discrete-target GR, nonzero old ordinary FP32 targets, self plus one remote peer, fan-in, num_sms32: summary d24204899b855d1f50ce6bd3246db713b722085023032940e4d413b105472e8a. Original workspace128MiB/rank is reported separately.

Both use original _lplusb_bench.py, two preflight plus two timed calls and original exact checks. Synthetic plans, external synchronization and ordinary test targets do not prove production R1/DDP/Q1/peer-final-use or a multi-remote-peer case. SHMEM INFO records one init-success per rank/case; two finalize invocations are observed, the second null-manager success, with the second caller UNKNOWN. No exactly-one-finalize claim. Both PLOG windows had5 files and0 observed ERROR; rootinfo-generation and shutdown warnings are retained.

Two earlier PUSH attempts failed before SHMEM init at CONFIG_STORE UID generation. Matching internal logs disproved a legacy-parser hypothesis: the actual path rejects loopback. With the actual non-loopback interface enp39s0f0:inet4, bounded UID-only and then both payload cases passed. Provider source, geometry and checks were unchanged. Bootstrap interface success alone does not prove physical URMA RNIC routing.

Original cleanTENPUf3/A5 OFF primitive tests also passed: three original BF16-input/nonzero-FP32-accumulator shapes plus the empty-input case,4 PASS/0 SKIP, original.02/.02 tolerance. Raw log 072d85d86af630b987722c0f3d60f76a771f1dd9c91daf8e05d82fef2e3cfa4a;2 PLOG files,0 observed ERROR. This is not GroupedLinear/DDP/training or ON direct-out qualification.

Prior MS5fb51 retains its fixed S1_MATH_ONLY PASS,29 managed Calls, real original-f3 fuser forward/backward, seeded BF16 projection/dgrad/FP32 producer/add/ReduceSum and probability tests. Receipt 9b4670876a80a13f89390482b216130f7a734f23d09b7ae0ca601ade312df8e4. Binaryd19 was explicitly reused after unchanged C++/build inputs, not described as rebuilt. That bounded old-source result is not whole-current-candidate acceptance.

Remaining merge blockers

Actual Torch-NPU38e483/post6 differs from the declared88d6 source tuple. Standard libopapi32efe vendor binary-to-source/direct-out/no-internal-staging proof remains UNKNOWN; numerical output equality or equal output pointers do not resolve it. Selected SDK maps also include preexisting NNAL ATB9.1.0. Original MA ABE has a matching OFF-discovery result; full production component/recipe/bootstrap admission remains open. External mindspeed_adaptor/MegatronAdaptor product and installation files stay unchanged.

Full S0/S1/S2 qualification remains incomplete. Earlier Core/DDP fixture failures are preserved; the new ordinary component has its own scoped result above. Production feature/custom-backward and full R1/final-use/DDP qualification, actual S3 and performance remain unaccepted/NOT_RUN as applicable. Preserve expertTP1 and PP/VPP/CP/modelTP targets; untested combinations remain NOT_RUN. No registration or gate bypass is implied by diagnostic results.

Unchanged training target:20 effective OFF/ON optimizer updates each, all finite per-update main losses, maximum relative loss error1%, absolute rank-max whole-step mean timing difference2% with repeatability; both manual-GC interval50 actually enabled, observed GC not subtracted. These training/performance checks are NOT_RUN.

Budget and status

MindSpeed repository total 14318 physical lines: 3518 production, 10800 tests/tools; 27123 including historical dedicated delivery support. Repository excess over6800 best-effort target is 7518, explicitly reported under existing authorization. This increment supplies missing actual-state/remote-route evidence and failure assertions, not another mathematical path. Counting scope, formatting, coverage and retained history are unchanged. Original PR19 remains3919/4500 against its approved base; TENPU task-source diff0. No provider/adaptor product changes.

Keep Draft until matched complete component and training requirements close. Ordinary push only; no merge, force-push, duplicate PR or threshold/gate bypass.

likedislike
The current Pull Request has been closed by Jia_Austin.
Jia_AustinJia_AustinCollaborators
24 days ago Created pull request, commit 78dfee85
ascend-robot
ascend-robotCollaborators
24 days ago Comments:
ascend-robotascend-robotCollaborators
24 days ago Added label: stat/needs-squash
ascend-robotascend-robotCollaborators
24 days ago Added label: ascend-cla/yes
ascend-robot
ascend-robotCollaborators
24 days 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/MindSpeed ❌ (0/2)(You can also ask: wuweiqiang24, glhyyz, 楚浩田, libaokui, clc2025) ❌ (0/1)(You can also ask: 郑加利, 郭鹏, 王智伟, wuweiqiang24, 韩俊)

💡 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
234 messages are collapsed here。 See more
ascend-robotascend-robotCollaborators
23 days ago Removed label: docs-ci-pipeline-running
ascend-robotascend-robotCollaborators
23 days ago Added label: docs-ci-pipeline-success
Jia_AustinJia_AustinCollaborators
23 days ago Modify description of pull request
Jia_AustinJia_AustinCollaborators
23 days ago Modify description of pull request
Jia_AustinJia_AustinCollaborators
23 days ago Close pull request