Skip to content

perf(megamoe): promote shared dX producer dependencies - #10

Open
dz-ssk wants to merge 1 commit into
davidhe91:megamoe-ascend950-integrationfrom
dz-ssk:perf/shared-dx-producer-dependencies
Open

dz-ssk wants to merge 1 commit into
davidhe91:megamoe-ascend950-integrationfrom
dz-ssk:perf/shared-dx-producer-dependencies

Conversation

@dz-ssk

@dz-ssk dz-ssk commented Dec 4, 2026 •

Copy link
Copy Markdown

When fused backward token-gradient restore waits for shared dX, promoting dX alone leaves its prerequisite shared dW1 in the FIFO tail. The same problem applies to shared dA and its prerequisite dW2. A ready shared producer can therefore remain behind routed weight-gradient work, delaying restoration.

Trace event dependencies recursively within the already eligible shared candidate set, including paired events, and promote the required Cube producers into the existing ready window. This completes the direct-producer handling from PR #9. Shared priority endpoints, output-event gating, task descriptors, event credits, native ABI, numerical operations, and transport completion rules remain unchanged. No new option is introduced.

Validation:

  • Based on 63a9af3 of megamoe-ascend950-integration.
  • 268 targeted CPU tests passed: input replay, shared experts, schedule options, backward epilogue, and runtime serialization. Includes dependency ordering, endpoint boundaries, and conservative queue liveness.
  • After rebasing, EP8 rank 0 and EP64 ranks 0/17/63 produce forward and backward serialized runtime hashes and candidate queues identical to the device-tested patch for the above target configuration.
  • Earlier EP64 device validation of the equivalent target-configuration schedule used T4096/card, H7168, I2560, TopK8, 512 experts, one shared expert, MXFP8, probability before FC2, input/activation replay, and FP32 weight gradients. Job: abcaf90d-0bf8-495e-9a79-819140cea147.
  • Against 8701a75 (before PR perf(megamoe): prioritize shared dX before routed weight gradients #9), normal backward decreased 13.517 → 12.916 ms (4.45%); full forward+backward decreased 21.284 → 20.702 ms (2.73%). Normal forward was 7.681 → 7.724 ms (+0.56%). Each group has 400 samples; take the maximum of 64 ranks per iteration, then P50.
  • Separately captured core backward decreased 12.334 → 11.297 ms; useful-GEMM MFU rose 76.08% → 83.07% using 865 TFLOPS/card. Extra replay FLOPs are excluded from the numerator while replay time is included.
  • These historical device results are against 8701a75, not an A/B measurement against PR perf(megamoe): prioritize shared dX before routed weight gradients #9 or 63a9af3. No new device numerical-equivalence qualification is claimed for this PR.

@dz-ssk
dz-ssk requested a review from davidhe91 as a code owner December 4, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant