Skip to content

Add expert-parallel no-sync symmetric-memory buffer pool - #739

Merged
AkshitaB merged 4 commits into
akshitab/moe-v2-corefrom
akshitab/moe-v2-ep-buffers
Jun 30, 2026
Merged

AkshitaB merged 4 commits into
akshitab/moe-v2-corefrom
akshitab/moe-v2-ep-buffers

Conversation

@AkshitaB

Copy link
Copy Markdown
Contributor

Adds the symmetric-memory buffer machinery shared by the no-sync expert-parallel forward paths.

What's added

nn/moe/v2/ep_no_sync_buffers.py:

  • Symmetric-memory tensor allocation + caching (with leading-dim reuse).
  • The lease pool that hands out and recycles those buffers across forward passes, so the no-sync all-to-all can read/write peer memory without reallocating each step.
  • The per-block shared pool and the stage / pending-context state the two-batch-overlap path threads between micro-batches (bf16 and rowwise-FP8 variants).

It operates on plain tensors / a passed-in block and depends only on olmo_core.kernels.olmo_symm_mem (+ torch); the EP forward families that consume it land in follow-up changes.

Notes

  • Removed the dead env-gated debug instrumentation (every call site was commented out); a single note on the OLMO_TBO_VERBOSE_DEBUG_PRINT trace switch remains at the allocation site.
  • Added a module docstring; lowercase tuple[...] type hints per convention.

Testing

src/test/nn/moe/v2/ep_no_sync_buffers_test.py (CPU): buffer-reuse coverage, prefix-view aliasing, env parsing (incl. error case), and the rank-capacity formula. make checks clean.

🤖 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.

AkshitaB and others added 4 commits June 29, 2026 21:59
The symmetric-memory buffer pool, leases, transient slots, stage state, and pending-context
machinery shared by the no-sync expert-parallel forward paths (bf16 and rowwise-FP8): allocation/
caching of symm tensors, lease acquisition + prewarming, and the per-block shared pool.

Co-authored-by: Tianhua Tao <[email protected]>

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
- Add a module docstring describing the symmetric-memory buffer/lease machinery.
- Remove the dead env-gated debug instrumentation (the module-level _tbo_buffer_debug_* and the
  unused _NoSyncSymmLeasePool._debug_* methods; every call site was commented out) and leave a
  single note on the OLMO_TBO_VERBOSE_DEBUG_PRINT trace switch at the allocation site.
- Use lowercase tuple[...] type hints per the merged-leaf convention.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Cover the pure helpers: buffer-reuse coverage (_cached_symm_tensor_covers — a cached symm
tensor serves a request only with a >= leading dim and matching trailing dims/dtype/device),
prefix-view aliasing (_view_cached_symm_tensor), env parsing (_parse_bool_env incl. the error
case), and the rank-capacity formula (compute_ep_no_sync_rank_capacity).

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
compute_ep_no_sync_rank_capacity is typed for MoEFusedV2TransformerBlock; annotate the
duck-typed SimpleNamespace stand-ins as Any so mypy accepts them.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
@AkshitaB
AkshitaB force-pushed the akshitab/moe-v2-ep-buffers branch from 10a5f55 to 7cbd4fb Compare June 30, 2026 05:00
@AkshitaB
AkshitaB merged commit 8a40bfe into akshitab/moe-v2-core Jun 30, 2026
59 of 70 checks passed
@AkshitaB
AkshitaB deleted the akshitab/moe-v2-ep-buffers branch June 30, 2026 06:07
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