[https://nvbugs/6430702][perf] Restore NVLink one-sided A2A fast path#16200
Conversation
|
/bot run --disable-fail-fast |
|
PR_Github #58505 [ run ] triggered by Bot. Commit: |
📝 WalkthroughWalkthroughAdds compile-time active-rank masking to MoE All-to-All CUDA dispatch/combine kernels via a new ENABLE_RANK_MASK template parameter and enable_rank_mask struct field, updates op-layer mask resolution to require an explicit mask, tightens Python communicator validation of active_rank_mask, and updates tests for the new dispatch routing metadata contract. ChangesActive-Rank Masking Gating
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant PythonCaller as MoeAlltoAll/NVLinkOneSided
participant Op as moeAlltoAllOp.cpp
participant Launch as moe_a2a_dispatch/combine_launch
participant Kernel as moeA2ADispatch/CombineKernel
PythonCaller->>Op: dispatch/combine(active_rank_mask?)
alt rank-mask mode disabled and mask provided
PythonCaller->>PythonCaller: raise ValueError
else mask provided or absent
Op->>Op: hasActiveRankMask(activeRankMask)
Op->>Op: set params.enable_rank_mask
opt mask present
Op->>Op: resolveActiveRankMask(validate mask)
end
Op->>Launch: launch(params)
alt enable_rank_mask true
Launch->>Launch: validate local ep_rank active
Launch->>Kernel: instantiate with ENABLE_RANK_MASK=true
else
Launch->>Kernel: instantiate with ENABLE_RANK_MASK=false
end
Kernel->>Kernel: is_rank_active<ENABLE_RANK_MASK> in sync loops
Kernel-->>PythonCaller: routed/combined output
end
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
PR_Github #58505 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #58689 [ run ] triggered by Bot. Commit: |
|
PR_Github #58689 [ run ] completed with state
|
Compile rank-mask checks out of non-FT kernels and keep masked checks in peer synchronization paths only. Restore the pre-regression combine payload loop, require routing to exclude inactive ranks before launch, and align rank-mask tests with committed-generation semantics. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Restore FT-only inactive-route protection, pass construction-time rank-mask mode explicitly through the op boundary, and keep mask checks out of combine payload accumulation. Reject CUDA graphs until generation-scoped recapture lands and add focused mode, route-safety, and graph-policy coverage. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
c8a0ab7 to
79c9cbc
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #58880 [ run ] triggered by Bot. Commit: |
|
PR_Github #58880 [ run ] completed with state
|
|
/bot run --disable-fail-fast --stage-list "DGX_B200-4_GPUs-PyTorch-2,DGX_B200-8_GPUs-PyTorch-3" |
|
PR_Github #59008 [ run ] triggered by Bot. Commit: |
|
PR_Github #59008 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #59031 [ run ] triggered by Bot. Commit: |
|
PR_Github #59031 [ run ] completed with state |
Summary
Root cause
The reported regression is between post-merge jobs 2825 and 2826:
7c8dde830bac813e23605d47a1d27c92d5437a92(12.88 ms)045705139d125dbfd0614b369096f7bb5ddcbebf(14.43 ms)The relevant kernel diff added two
is_rank_activechecks insidevectorized_combine_impl: one in the payload-load pass and another in the conversion pass. These execute in the token/top-k/vectorized payload hot path even when every rank is active.Design alignment
The active-rank mask is a next-launch primitive. The full post-commit routing guarantee is not yet enforced end to end, so the masked dispatch specialization defensively rejects inactive route targets before remote workspace access. That sentinel is an internal fail-closed artifact, not valid model output. A failed or generation-mismatched epoch must be discarded.
The compile-time flag is named
ENABLE_RANK_MASKrather thanENABLE_FAULT_TOLERANCEso it remains independent from the running-kernel execution-abort mechanism. Its value is fixed when the communicator is constructed; the mask tensor supplies one epoch's committed membership. The masked specialization skips inactive peers in route, completion, counter, and EPLB-stat paths, but not in combine payload accumulation.The mask remains captured by value in kernel arguments. Rank-mask mode therefore rejects configured CUDA graphs and direct stream capture until the 1a.11 generation-scoped graph lifecycle lands.
Related: #15524, #16025
NVBUG: https://nvbugs/6430702
Validation
clang-format --dry-run --Werroron the changed C++/CUDA filesruff checkandruff format --checkon the changed non-legacy Python filesscripts/legacy_utils.py lint-precommit tensorrt_llm/_torch/distributed/moe_alltoall.pyscripts/legacy_utils.py lint-precommit tensorrt_llm/_torch/custom_ops/cpp_custom_ops.pyyapf -d tensorrt_llm/_torch/distributed/moe_alltoall.pyyapf -d tensorrt_llm/_torch/custom_ops/cpp_custom_ops.pygit diff --check7c8dde83Not run locally: CUDA build, MPI multi-GPU tests, or performance benchmarks because this worktree has no TRT-LLM build environment,
nvcc, orpytest. These require CI/GPU validation.