8000 Add Lanes: several Buffers on one group by Etelis · Pull Request #32 · afdEP/afdEP-comm · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /div>

Add Lanes: several Buffers on one group - #32

Merged
Etelis merged 2 commits into
buffer-integration-apifrom
lanes
Nov 15, 2026
Merged

Etelis merged 2 commits into
buffer-integration-apifrom
lanes

Conversation

@Etelis
@Etelis Etelis commented Nov 15, 2026
Copy link
Copy Markdown
Member

Stacked on #31; only the last two commits are new.

What and why

Overlapping exchanges (DBO) needs one Buffer per lane, and until now the caller had to set AFD_DEEPEP_PER_BUFFER_COMM_STREAM=1 before building them. Lanes does that for the caller:

lanes = Lanes(group=group, config=config, lanes=2)
lanes[0].source_dispatch(...)  # each lane is an ordinary Buffer
lanes.close()
  • Checks every rank asks for the same number of lanes.
  • Gives each lane its own communication stream, and raises if two lanes share one.
  • Closes the lanes in reverse order.
  • With lanes=1 it behaves like a single Buffer.

Which exchange runs on which lane, and the call order, stay with the caller.

The env var is set only while the Buffers are constructed and then restored, because the native code reads it at construction. A constructor flag would be cleaner but is a native change; this PR has none, so the source digest is unchanged.

Checks

  • python -m pytest tests/unit, ruff check . and ruff format --check . pass
  • GPU suite with --lanes 2 (BF16 and FP8, hybrid on and off). Not run yet, so this is a draft.

Evidence

Pending the GPU run:

EP_DISABLE_GIN=1 torchrun --standalone --nproc-per-node=4 \
    -m tests.gpu.deepep --payload fp8 --hybrid off --capacity 32 --lanes 2

Lanes builds one Buffer per lane, checks every rank asks for the same
number, and gives each lane its own communication stream, so callers no
longer set the stream environment variable themselves. It is set only
while the Buffers are constructed and then restored.

Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
--lanes N now builds its Buffers through Lanes.

Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
@Etelis
Etelis marked this pull request as ready for review November 15, 2026 14:22
@Etelis
Etelis requested a review from almogtavor as a code owner November 15, 2026 14:22
@github-actions
github-actions Bot commented Nov 15, 2026 •
Copy link
Copy Markdown
PR Preview Action v1.8.2
Preview removed because the pull request was closed.
2026-11-15 14:47 UTC

@Etelis
Etelis merged commit 24225e5 into buffer-integration-api Nov 15, 2026
5 checks passed
@Etelis
Etelis deleted the lanes branch November 15, 2026 14:47
@Etelis Etelis mentioned this pull request Nov 16, 2026
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

0