You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6a45755
Browse filesBrowse the repository at this point in the historyBrowse files
fix(offload): make the load-wait hold DP-group aware; install it only for early-load tiers
Review round 6 (#3772), items 1 and 2. The hold stays on by default.
Item 1 (option a): the hold's bound now sees the DP group.
- DPEngineCoreProc._execute_dummy_batch calls the step hooks'
on_forward_done with the dummy forward's wall time, so an idle rank's tick
is the group's step, not its own last (often long prefill) forward.
- _sync_dp_state sends a fifth flag on its existing MAX all_reduce, this
rank's Scheduler.has_running_decode(), and keeps the reduced value as
dp_group_decoding (no new collective; kept between syncs).
- LoadWaitState.budget_s(..., group_decoding=True) returns 0: while any rank
decodes, a hold would add to that decode's ITL at the next collective.
With no decode anywhere (a P/D prefill instance, the measured case) the
bound is unchanged.
Item 2: load_wait_hook returns None unless the engine's KV connector has an
offload tier that loads early (supports_early_load: Mooncake Store), so a
dense or DSV4 offload tier, whose LoadExecutor also rings the doorbell, gets
no hook. Env and docs rows say so instead of "inert".
Tests: dummy forward updates the tick; a peer decode makes the budget 0 and
keeps a step from holding; a prefill-only group keeps the hold and its bound;
_sync_dp_state carries any rank's decode; no hook for a dense / missing
connector. The two _sync_dp_state tests follow the five-flag payload.
Copy file name to clipboardExpand all lines: docs/distributed_guide.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,15 +109,17 @@ The `stateless_init_dp_group()` method (in `ParallelConfig`) calls `stateless_in
109
109
110
110
### Synchronized busy loop
111
111
112
-
The DP busy loop overrides the base `EngineCore.busy_loop()` to synchronize state across DP ranks: every round by default, every N paired rounds after a busy sync with `ATOM_DP_SYNC_INTERVAL` (see [DP state sync interval](#dp-state-sync-interval)). The `_sync_dp_state()` method packs three signals into an int64 tensor and performs a single `AllReduce(MAX)`:
112
+
The DP busy loop overrides the base `EngineCore.busy_loop()` to synchronize state across DP ranks: every round by default, every N paired rounds after a busy sync with `ATOM_DP_SYNC_INTERVAL` (see [DP state sync interval](#dp-state-sync-interval)). The `_sync_dp_state()` method packs five signals into an int64 tensor and performs a single `AllReduce(MAX)`:
113
113
114
114
```python
115
-
# State synced: [has_unfinished, shutdown, held]
115
+
# State synced: [has_unfinished, shutdown, held, hidden, decoding]
116
116
state_tensor = torch.tensor(
117
117
[
118
-
1if local_has_unfinished else0,
119
-
1if local_shutdown else0,
120
-
1if local_held else0,
118
+
int(local_has_unfinished),
119
+
int(local_shutdown),
120
+
int(local_held),
121
+
int(local_hidden), # ATOM_DP_IDLE_WHEN_BLOCKED: work the vote left out
-**All ranks run a step together**: when any rank has unfinished work, every rank steps, an idle one with a dummy batch. The step's phase and padded shape are agreed per step by `ForwardMode.decide`.
131
133
-**Graceful shutdown**: all ranks must agree before exiting.
132
134
-**One hold holds the group**: a rank paused, offloaded or fenced for a weight sync holds every rank, so their forwards stay paired.
135
+
-**The group's decodes are visible to every rank**: `dp_group_decoding` is set when any rank has a running decode, so a rank that would delay its next forward (the offload load-wait hold, `ATOM_OFFLOAD_LOAD_WAIT_HOLD`) does not add to a peer's ITL.
0 commit comments