Skip to content

Fix low-latency EP epoch race with host-assigned dispatch epochs - #875

Merged
Caio Rocha (caiocbr) merged 11 commits into
feature/epfrom
caiorocha/fix_flag
Aug 14, 2026
Merged

Fix low-latency EP epoch race with host-assigned dispatch epochs#875
Caio Rocha (caiocbr) merged 11 commits into
feature/epfrom
caiorocha/fix_flag

Conversation

@caiocbr

@caiocbr Caio Rocha (caiocbr) commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Assign low-latency dispatch epochs once in MoELowLatencyRuntime and pass the epoch to dispatch and combine through Workload.

Previously, each CUDA block derived the epoch from device workspace state while block 0 updated that state without a grid-wide ordering guarantee. Late blocks could therefore observe a different epoch and wait indefinitely on readiness flags.

Changes

  • Add a host-owned dispatch epoch counter to MoELowLatencyRuntime.
  • Increment the epoch once before each dispatch.
  • Pass the same epoch to dispatch and its subsequent combine operation.
  • Use the workload epoch for rank-major synchronization.
  • Remove device-side epoch generation, publication, and workspace storage.

This gives every block in a launch one immutable epoch value.

Validation

  • Passed eager rank-major tests at capacities 1 and 2.
  • Passed eager expert-major tests at capacity 2.
  • Passed bit-exact 2-rank and 4-rank multi-operation CUDA Graph replays.
  • Passed all 10 SGLang dispatcher tests.
  • Completed six 32-rank serving rounds with 40/40 responses and no scheduler watchdog timeouts.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Moves low-latency dispatch epoch assignment from GPU workspace state to the host runtime.

Changes:

  • Adds host-managed dispatch epochs to workloads.
  • Uses workload epochs for dispatch/combine synchronization.
  • Removes the workspace epoch allocation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/ext/ep/low_latency/dispatch.cu Consumes workload epoch.
src/ext/ep/low_latency/config.cuh Removes workspace epoch storage.
src/ext/ep/low_latency/combine.cu Uses workload epoch for synchronization.
src/ext/ep/ll_runtime.hpp Adds host epoch state.
src/ext/ep/ll_runtime.cc Assigns and propagates epochs.
src/ext/ep/include/api.cuh Adds epoch to Workload.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ext/ep/ll_runtime.cc Outdated
@caiocbr Caio Rocha (caiocbr) changed the title Flag assignment on application side Fix low-latency EP epoch race with host-assigned dispatch epochs Aug 14, 2026
Comment thread src/ext/ep/low_latency/combine.cu Outdated
@caiocbr
Caio Rocha (caiocbr) merged commit 10b8449 into feature/ep Aug 14, 2026
4 of 5 checks passed
@caiocbr
Caio Rocha (caiocbr) deleted the caiorocha/fix_flag branch August 14, 2026 20:30
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.

3 participants