Repository navigation
Add the 1D no-sync two-batch-overlap forward - #741
Merged
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
combined_forward_ep_no_sync_tbo and its stage pipeline (stage_a / stage_c_launch / stage_d_launch / stage_e / stage_tail): the two-batch-overlap variant of the 1D no-sync expert-parallel forward, overlapping one micro-batch's all-to-all with the other's compute over the symmetric-memory transport. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
- Use the shared _nvtx.annotate helper (subsystem-colored ranges) instead of raw nvtx; snake_case the range labels and normalize colors to the subsystem scheme (routed-experts -> experts, attn+router -> routing, TBO stages -> tbo). - Use lowercase tuple[...] / X | Y type hints. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
AkshitaB
force-pushed
the
akshitab/moe-v2-ep-tbo-1d
branch
from
June 30, 2026 07:53
25d9ab0 to
56cdc13
Compare
Multi-GPU test asserting the two-batch-overlap no-sync forward produces the same loss and gradients as the non-TBO no-sync forward (ep_no_sync_1d, now on core). Ported from the dev branch; sets OLMO_USE_OWN_SYMM_MEM=0 (the VDev-1d machinery uses the legacy symm-mem backend) and installs a deterministic top-k router via routed_experts_router.forward (the dev test patched a no-longer- present block.router_forward). The sync-EP TBO variant is deferred until the sync EP family lands. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
MoEFusedV2TransformerBlockConfig takes one layer_norm (it builds both attention and feed-forward norms from it), not the attention_norm/feed_forward_norm split the dev config used. Passing the split fields was an unexpected-keyword mypy error (and would fail at runtime). Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
model.forward_tbo calls block.combined_forward_ep_tbo unconditionally, which imported the (not-yet-landed) ep_sync_tbo module before any sync/no-sync dispatch could run, so no-sync TBO models failed with ModuleNotFoundError. The dev branch makes this dispatch inside ep_sync_tbo.combined_forward_ep_tbo; hoist it to the block method so the no-sync path routes to combined_forward_ep_no_sync_tbo without importing the sync module, and the sync import stays deferred to the sync branch. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
AkshitaB
force-pushed
the
akshitab/moe-v2-ep-tbo-1d
branch
from
June 30, 2026 08:52
5affee1 to
d3bcde6
Compare
_tbo_last_step eagerly imported both no-sync TBO families (ep_no_sync_tbo_1d and ep_no_sync_tbo_rowwise) at the top of the function to drive isinstance dispatch, so a model running the VDev-1d no-sync TBO path still required the rowwise module to be importable and failed with ModuleNotFoundError when it was absent. Dispatch on the producing block's ep_no_sync_use_rowwise_all_to_all flag instead (it already selects the family in combined_forward_ep_no_sync_tbo) and import only the family in use, matching the lazy-dispatch convention the rest of block/model already follow. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
AkshitaB
force-pushed
the
akshitab/moe-v2-ep-tbo-1d
branch
from
June 30, 2026 09:12
04d6007 to
bfa3978
Compare
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.
Adds the two-batch-overlap (TBO) variant of the 1D no-sync expert-parallel forward.
What's added
nn/moe/v2/ep_no_sync_tbo_1d.py—combined_forward_ep_no_sync_tboand its stage pipeline (ep_no_sync_stage_a/stage_c_launch/stage_d_launch/stage_e/stage_tail, plus the_NoSyncTboPendingContextcarried between stages). It splits a micro-batch into two halves and overlaps one half's symmetric-memory all-to-all with the other half's compute. Driven by the model'sforward_tbo/_tbo_last_step(which lazy-import it).Depends only on the comm transport, the no-sync common helpers, and the symmetric-memory buffer pool (all on
moe-v2-core).Notes
_nvtx.annotate(label, subsystem)helper.Testing
The applicable dev test (
v2_tbo_test.py, no-sync variant — TBO output must match the non-TBO no-sync forward) compares against the non-TBOcombined_forward_ep_no_sync_1d, so it lands once that forward (ep_no_sync_1d) is on the branch. The sync-TBO variant needs the sync EP family. Both are multi-GPU.🤖 Generated with Claude Code