Skip to content

Add a FIFO ticket lock over a torch.distributed store - #2143

Open
fzyzcjy wants to merge 1 commit into
tom/refactor-miles/op9-15from
tom/refactor-miles/op12-1
Open

Add a FIFO ticket lock over a torch.distributed store#2143
fzyzcjy wants to merge 1 commit into
tom/refactor-miles/op9-15from
tom/refactor-miles/op12-1

Conversation

@fzyzcjy

@fzyzcjy fzyzcjy commented Aug 4, 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/op9-15 branch from adb1caa to dd88fa0 Compare August 6, 2026 07:03
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch 2 times, most recently from 3558c4e to 9697adf Compare August 9, 2026 23:31
@fzyzcjy
fzyzcjy requested a review from yushengsu-thu as a code owner August 9, 2026 23:31
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch from dd88fa0 to ff5d591 Compare August 9, 2026 23:33
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch from 9697adf to 9ffac37 Compare August 10, 2026 05:59
@fzyzcjy
fzyzcjy requested a review from Rockdu as a code owner August 10, 2026 05:59
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch from ff5d591 to 82d9cdb Compare August 10, 2026 06:08
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch from 9ffac37 to 9116b42 Compare August 10, 2026 16:06
@fzyzcjy
fzyzcjy requested a review from Ying1123 as a code owner August 10, 2026 16:06
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch from 82d9cdb to f490c5f Compare August 10, 2026 16:07
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch from 9116b42 to f657fc7 Compare August 10, 2026 16:33
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch 2 times, most recently from 5ed2c39 to f5d8d99 Compare August 12, 2026 02:48
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch 2 times, most recently from 5efda26 to 7dcf53b Compare August 12, 2026 14:31
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch from f5d8d99 to 407c863 Compare August 12, 2026 14:31
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch 3 times, most recently from a960834 to bfad33c Compare August 13, 2026 03:25
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch from 6e3788d to 3bf836e Compare August 13, 2026 03:25
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch from bfad33c to 8b66f2c Compare August 13, 2026 06:00
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch from 3bf836e to c10abc9 Compare August 13, 2026 06:01
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch from 8b66f2c to e43aa5c Compare August 13, 2026 06:39
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch 2 times, most recently from 084464f to c4b79af Compare August 14, 2026 04:45
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch from e43aa5c to 9c04d57 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: #2144 retains the engine lock for the updater lifetime, resolving the rank-0 TCPStore lifetime concern on the production path; this remains true through the checked #2649 tip.

The rollout engines are guarded by a ray Lock actor, which costs a handle
passed across processes and, worse, stays locked forever when its holder
dies. A ticket lock over a store owned by the training world has neither
problem: two monotonic counters, no rollback, no reset, and a store whose
lifetime is rank 0's process.

Ranks that never contend still join the address broadcast, which is
collective, but open no connection to the store. A critical section that
raises keeps the lock, since the failed holder's remote work may still be
in flight; recovery there is the same cell teardown a crash gets.

The tests exercise the queue over a real TCPStore, where it actually spans
processes: separate connections share one queue, a holder that disappears
keeps its ticket, and a rank polling a store whose host died raises instead
of spinning. Blocking is proven by the counters rather than by a stopwatch,
so a lock that never waited cannot pass, and every wait is bounded and every
helper process reaped so a broken lock fails the suite instead of hanging it.
A scripted store and a fake clock pin the wait loop's warning throttle, the
poll-interval sleep, and the first-warning deadline; the factory side pins
the gloo-group broadcast, kwarg forwarding, abstainer connection avoidance,
and IPv6 addresses.

This commit only adds the utility; the switch follows.
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op12-1 branch from 9c04d57 to 4618ca5 Compare August 29, 2026 12:38
@fzyzcjy
fzyzcjy force-pushed the tom/refactor-miles/op9-15 branch from c4b79af to d2a3147 Compare August 29, 2026 12:40
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