Skip to content

Add the sync-to-async bridge for fire-then-rendezvous call sites - #1855

Open
fzyzcjy wants to merge 1 commit into
tom/refactor-miles/op3-10from
tom/refactor-miles/op3-11
Open

Add the sync-to-async bridge for fire-then-rendezvous call sites#1855
fzyzcjy wants to merge 1 commit into
tom/refactor-miles/op3-10from
tom/refactor-miles/op3-11

Conversation

@fzyzcjy

@fzyzcjy fzyzcjy commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Part of #1837

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch from d562b1e to a34bbc3 Compare August 3, 2026 23:44
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-10 branch from 1c21446 to 60bb61f Compare August 3, 2026 23:44
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch from a34bbc3 to 89cfb93 Compare August 4, 2026 00:39
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-10 branch from 2eb2e1b to cd4c421 Compare August 4, 2026 06:56
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch from 89cfb93 to 839790f Compare August 4, 2026 06:56
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-10 branch from cd4c421 to de62d6c Compare August 10, 2026 06:06
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch from 839790f to f81e650 Compare August 10, 2026 06:06
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-10 branch from de62d6c to f9e3ec9 Compare August 10, 2026 16:07
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch from f81e650 to b235bfb Compare August 10, 2026 16:07
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-10 branch from f9e3ec9 to ce44b07 Compare August 10, 2026 16:34
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch 2 times, most recently from 9698dc9 to 7a52c65 Compare August 12, 2026 02:48
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-10 branch from 6a5194c to c407f31 Compare August 12, 2026 14:31
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch from 7a52c65 to 9fd9ece Compare August 12, 2026 14:31
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-10 branch from c407f31 to 9340358 Compare August 12, 2026 23:56
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch 2 times, most recently from 8b7379f to dd79ed4 Compare August 13, 2026 06:01
Three engine endpoints — init_weights_update_group,
update_weights_from_distributed and load_lora_adapter_from_distributed —
block server-side until the NCCL collective forms, and the other party to
that collective is the caller itself. The caller must therefore have every
request on the wire before it blocks. Ray's `.remote()` gave that for free;
an HTTP client has to rebuild it.

`AsyncLoopThread.submit` returns a `concurrent.futures.Future` instead of
blocking, so synchronous trainer code keeps its fire → collective → collect
shape. A background loop rather than a thread pool: a pool with fewer
workers than engines queues the last requests behind the collective that is
waiting for them.

`wait_futures` is the collection point. It takes ray ObjectRefs and futures
alike so a call site can migrate its fan-out without changing shape, and it
settles every future before raising, since abandoning the rest would leave
requests running against engines the caller believes it is done with.
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op3-11 branch from dd79ed4 to 7666abc Compare August 14, 2026 04:46

@guapisolo guapisolo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved for the #2176 safe-merge checkpoint: the sync-to-async bridge preserves the intended fire-then-rendezvous semantics, with no blocking finding through the checked chain tip.

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.

2 participants