fix(a2a3/tensormap): propagate early-dispatch from the sync_start drain path#1296
Conversation
…in path propagate_dispatch_fanin — the event that turns a flagged producer's dispatch into early-dispatch candidacy for its consumers — was only called on the normal ready-pop dispatch path (scheduler_dispatch.cpp). A sync_start task dispatches through the separate drain path (handle_drain_mode/drain_worker_dispatch in scheduler_completion.cpp), which never propagated. So any consumer whose only flagged producer is a sync_start (drain-dispatched) task never became an early-dispatch candidate. Mirror the normal path: after drain_worker_dispatch publishes all of the drained producer's blocks, call propagate_dispatch_fanin once. Idempotent via the dispatch_propagated once-guard; the internal gate no-ops for an unflagged producer, so recording unconditionally is cheap. Only sync_start producers reach the drain path (a non-sync_start task that doesn't fit is re-queued and propagates via the normal path on eventual dispatch), so the fix is scoped to exactly the gap. Verified on a2a3: qwen3-14B decode_fwd (2-layer) early-dispatched-task count 35 -> 83 with the fix (+48 = the 24 out_proj tiles/layer whose sole producer is the sync_start fa_fused). sync_start scene tests (spmd_sync_start*) pass and cpput WiringTest 19/19 pass unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change adds a call to ChangesDrain Dispatch Fanin Propagation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the drain_worker_dispatch function in scheduler_completion.cpp to call sched_->propagate_dispatch_fanin(*slot_state). This ensures that the drain path correctly increments its consumers' dispatch fan-in, allowing consumers whose only flagged producer is a sync_start task to become early-dispatch candidates. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
propagate_dispatch_fanin— the event that turns a flagged producer'sdispatch into early-dispatch candidacy for its consumers — was only called on
the normal ready-pop dispatch path (
scheduler_dispatch.cpp:457). Async_starttask dispatches through the separate drain path(
handle_drain_mode→drain_worker_dispatchinscheduler_completion.cpp),which never propagated.
Consequence: any consumer whose only flagged producer is a sync_start
(drain-dispatched) task never became an early-dispatch candidate — it wasn't
gated and it had spare (idle/pending) cores to stage onto; the candidate-enqueue
event itself was simply missing.
Fix
After
drain_worker_dispatchpublishes all of the drained producer's blocks(the producer is now dispatched), call
propagate_dispatch_faninonce —mirroring the normal path's post-publish propagate.
dispatch_propagatedonce-guard.unconditionally is cheap (same as the normal path).
sync_starttasks reach the drain path(
scheduler_dispatch.cppre-queues a non-sync_start task that doesn't fit, soit propagates via the normal path on eventual dispatch).
Testing
decode_fwd(2-layer) early-dispatched-taskcount 35 → 83 with the fix. The +48 are exactly the 24
out_projtiles/layer whose sole producer is the
sync_startfa_fused— previouslystuck out of early-dispatch, now pre-staged onto pending slots while
fa_fusedruns.
spmd_sync_start/_aiv/_edge/_stressscene tests pass (no drainregression).
WiringTest19/19 pass.Testing checklist