Repository navigation
Add the 1D expert-parallel no-sync forward - #740
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. |
Base automatically changed from
akshitab/moe-v2-ep-buffers
to
akshitab/moe-v2-core
June 30, 2026 06:07
combined_forward_ep_no_sync_1d: the VDev (variable-length) no-sync expert-parallel forward that dispatches tokens to expert-owning ranks via the symmetric-memory all_to_all_vdev ops (comm), runs the routed experts, and combines back. Shared by the 1D two-batch-overlap path. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
- Use the shared nn/moe/v2/_nvtx annotate helper (subsystem-colored ranges) instead of raw nvtx.annotate; snake_case the range labels per convention. - Use lowercase tuple[...] / X | Y type hints. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Port the VDev-1d no-sync tests from the dev branch that don't require the (not-yet-landed) sync EP family: capacity-drop behavior and quota invariants (multi-GPU; assert against the block's _ep_no_sync_last_debug counters), the symmetric-memory hard-fail setup (multi-GPU), and the 2D-all-to-all rejection (GPU — block construction allocates CUDA events before the config check, so it can't run on CPU). The no-sync-vs-sync parity test 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]>
AkshitaB
force-pushed
the
akshitab/moe-v2-ep-1d
branch
from
June 30, 2026 06:09
1cf8bbc to
bc649d6
Compare
The VDev-1d (non-rowwise) no-sync path only runs on the legacy torch symmetric-memory backend — OLMo-owned symm-mem (default on) supports only the rowwise path, so apply_ep rejects it. Set OLMO_USE_OWN_SYMM_MEM=0 in the forward/apply_ep tests, and add a TODO(ep-legacy) on the forward about removing this path once TBO no longer needs the 1D machinery and rowwise is the sole no-sync path. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
activation_debug.maybe_dump_ep_no_sync_saved_activations is imported unconditionally by the no-sync forward in block.py, so it must be present for that path to run (it's a no-op passthrough unless OLMO_EP_NO_SYNC_SAVED_ACTIVATIONS_DEBUG is set). It uses train.globals for a once-per-block dump flag (lazy import, only hit when the dump is enabled), so train/globals.py comes with it. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Add a module docstring and use lowercase tuple[...] / X | Y type hints. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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 1D (VDev) no-sync expert-parallel forward.
What's added
nn/moe/v2/ep_no_sync_1d.py—combined_forward_ep_no_sync_1d: dispatches each token to its expert-owning rank over the symmetric-memory variable-length all-to-all (_DispatchVDevAutograd), runs the routed experts on the received tokens, and combines the results back (_CombineVDevAutograd), using the buffer-lease pool for the symmetric buffers. Also shared by the 1D two-batch-overlap path.Operates on a passed-in block; built on the comm transport, the no-sync common helpers, and the symmetric-memory buffer pool.
Notes
_nvtx.annotate(label, subsystem)helper.Testing
This is a multi-rank symmetric-memory forward with no single-process surface (its only pure logic, rank-capacity, is already covered). It's validated end-to-end by the multi-GPU EP-vs-no-EP parity test that lands with the no-sync forward path.
🤖 Generated with Claude Code