Repository navigation
Add rowwise no-sync EP route-map and metrics helpers - #742
Merged
AkshitaB merged 12 commits intoJul 1, 2026
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. |
build_rowwise_route_maps (per-rank routing maps for the rowwise all-to-all) and the rowwise no-sync metric accumulators (add/accumulate/reset_ep_no_sync_rowwise_metrics) shared by the rowwise no-sync forward paths and read by the block's auxiliary-metrics path. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
- Remove the dead env-gated route-map debug instrumentation (the _rowwise_route_debug_* helpers + their commented call sites) and leave the trace note in the module docstring. - Use the shared _nvtx.annotate helper; lowercase tuple[...] hints; drop now-unused os/dist imports; add a module docstring. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Port the metric-accumulation tests (accumulate/add/reset_ep_no_sync_rowwise_metrics): drop rate + symm-buffer utilization with reduce types, and the zero-capacity ignore case. Uses a SimpleNamespace fake block (annotated Any) so it runs on CPU. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
combined_forward_ep_no_sync_rowwise: the production no-sync forward — dispatches/combines tokens over the rowwise symmetric-memory all-to-all with on-the-wire MXFP8, runs the routed experts, and overlaps the shared experts. Runs under the default OLMo-owned symm-mem backend. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
combined_forward_ep_no_sync_tbo_rowwise and its stage pipeline: the two-batch-overlap variant of the rowwise no-sync expert-parallel forward, overlapping one micro-batch's rowwise all-to-all with the other's compute. Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
- Remove the dead env-gated debug instrumentation (_tbo_debug_* helpers + their commented call sites) and note the OLMO_TBO_VERBOSE_DEBUG_PRINT trace switch in the module docstring. - Use the shared _nvtx.annotate helper (subsystem-colored ranges) with snake_case labels; lowercase tuple[...] / X | Y hints; drop now-unused os/dist imports. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Multi-GPU test: the rowwise no-sync EP forward produces the same output and (globally-summed) gradients as the dropless no-EP reference, with deterministic top-k routing under a capacity that keeps every token. The rowwise path runs on the default OLMo-owned symm-mem backend, so no env override is needed. The rowwise-vs-sync and TBO-rowwise tests are deferred (sync EP family / the dispatch test targets the pre-lazy-refactor block API). Co-authored-by: Tianhua Tao <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Per the docstring convention: add a module docstring to ep_no_sync_rowwise and docstrings to the rowwise metric helpers and the TBO stage pipeline + its combined_forward entry point. Also annotate down_anchor as torch.Tensor (it starts as a Parameter and is reassigned to a detached Tensor) to fix a mypy narrowing error. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
apply_ep configures the rowwise symmetric-memory buffers and (under the default OLMo-owned symm-mem backend) rejects the non-rowwise VDev path, so ep_no_sync_use_rowwise_all_to_all and the nblocks must be set before apply_ep, not after. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
AkshitaB
force-pushed
the
akshitab/moe-v2-ep-rowwise-helpers
branch
from
June 30, 2026 09:39
0ebc4f8 to
bf5de07
Compare
With both no-sync TBO families present, the 1d and rowwise stage functions take different pending-context types, so aliasing them to a shared import name made mypy report an incompatible-import (and the object-typed context failed the rowwise arg type). Bind them through Any-typed locals instead; the runtime family always matches the context type. No behavior change. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
… absent The rowwise no-sync path uses the OLMo-owned symmetric-memory backend, which needs the compiled GPU-side symm_mem_vdev2d extension. The CI image does not build it, so the parity test errored in apply_ep with ModuleNotFoundError. Add a requires_symm_mem_vdev2d guard (mirroring requires_grouped_gemm / requires_te) that detects the compiled extension and skips when it is unavailable, and apply it to the parity test. A TODO on the guard tracks rebuilding the CI image with the extension so the test runs. 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.
First piece of the rowwise no-sync expert-parallel path (the production no-sync path).
What's added
nn/moe/v2/ep_no_sync_rowwise_helpers.py:build_rowwise_route_maps— per-route destination rank/row maps for the rowwise all-to-all (tail-dropped routes encoded as-1).accumulate_/add_/reset_ep_no_sync_rowwise_metrics— per-block drop-rate and symm-buffer-utilization counters, read by the block's auxiliary-metrics path (which already lazy-imports them).Clean leaf — depends only on
get_rank+ torch (block ref isTYPE_CHECKING-only).Notes
OLMO_TBO_VERBOSE_DEBUG_PRINT) is noted in the module docstring._nvtx.annotatehelper; lowercasetuple[...]hints; module docstring.Testing
src/test/nn/moe/v2/ep_no_sync_rowwise_helpers_test.py(CPU): metric accumulation (drop rate + symm-buffer util with reduce types) and the zero-capacity ignore case.make checksclean.🤖 Generated with Claude Code