Skip to content

Add the 1D expert-parallel no-sync forward - #740

Merged
AkshitaB merged 6 commits into
akshitab/moe-v2-corefrom
akshitab/moe-v2-ep-1d
Jun 30, 2026
Merged

AkshitaB merged 6 commits into
akshitab/moe-v2-corefrom
akshitab/moe-v2-ep-1d

Conversation

@AkshitaB

Copy link
Copy Markdown
Contributor

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 ranges use the shared _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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Base automatically changed from akshitab/moe-v2-ep-buffers to akshitab/moe-v2-core June 30, 2026 06:07
AkshitaB and others added 3 commits June 29, 2026 23:09
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
AkshitaB force-pushed the akshitab/moe-v2-ep-1d branch from 1cf8bbc to bc649d6 Compare June 30, 2026 06:09
AkshitaB and others added 3 commits June 30, 2026 00:02
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]>
@AkshitaB
AkshitaB merged commit bb8d973 into akshitab/moe-v2-core Jun 30, 2026
43 of 47 checks passed
@AkshitaB
AkshitaB deleted the akshitab/moe-v2-ep-1d branch June 30, 2026 07:52
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