Optimize DeepEP metadata-to-GEMM launch bridge - #68
Draft
A-nnonymous wants to merge 3 commits into
Draft
Conversation
Pack DeepEP scale carriers without materialization, allocate independent gated outputs in the native metadata bridge, and bypass generic gated GEMM launch setup with a pointer-safe TVM FFI path. Add byte-exact, live-context, large-shape, and fallback regression coverage.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main_grad.Companion Fleet PR: PaddlePaddle/PaddleFleet#1458
Correctness fix
Fleet converts both down-projection weight and
main_gradto Sonic layout[E, H, I]. The BF16 wgrad result has the same logical shape, but the previous path wrote it through an[E, I, H]transposed view. The kernel accepted the mismatched view and silently corrupted the persistent optimizer buffer. This PR writes directly to[E, H, I]and rejects any output or accumulator whose logical shape does not match the GEMM contract.The fused router edge keeps metadata scores forward-only, scatters
dscoreto the current source tensor, and does not cache microbatch tensor pointers.Validation
[E, H, I]and reject the old transposed shape.dscore,dz, anddw2are bit-exact against the standalone carrier path; metadata receives no gradient.6.49e-4, versus1.91e-2before the fix, under the same nondeterministic settings.Performance
On the same steady-state integration trace, dispatch-to-gated-GEMM idle latency changed from 208.4 us to 85.5 us at p50 and from 243.3 us to 104.4 us at p95.
Compatibility
Capability, shape, and pointer checks retain the validated fallback paths. No barrier logic or persistent parameter-buffer ownership is changed.