feat(rlix): sender-side NCCL broadcast + topology support (rlix#42) - #37
Open
zhenyulincs wants to merge 1 commit into
Open
feat(rlix): sender-side NCCL broadcast + topology support (rlix#42)#37zhenyulincs wants to merge 1 commit into
zhenyulincs wants to merge 1 commit into
Conversation
- actor.py _dispatch_nccl_broadcast: remove the fail-fast guard; sender joins the dynamic group as rank 0 with a budget-bounded rendezvous (pg timeout doubles as the per-collective NCCL-watchdog bound), per-bucket metadata-then-broadcast under a cumulative transport deadline, memory-preflighted staging with tensor-by-tensor degradation, sender-owned finally teardown (cancel nested refs, destroy both sides), fail-fast if NCCL async error handling is explicitly disabled - rollout.py: RolloutManager.register_router_if_active — atomic active-only router re-admission serialized against shrink_engines (rlix sync-under-load bracket counterpart); skips (not raises on) concurrently-shrunk engines - drivers: two-family per-pipeline topology invariant (subset overlap OR fully-disjoint dedicated-train; partial intersections rejected) in run_miles_dual env parsing + _build_pipeline; run_miles_rlix gains MILES_SINGLE_TRAIN_GPUS/INFER_GPUS explicit-mapping override with CLI-count length validation (minimal all-NCCL topology) - tests: sender dispatch ordering/abort/preflight (16), single-mapping override matrix (9), register_router_if_active contract (4) All changes confined to RLix-port-added code; no pristine upstream lines touched. Companion rlix PR: rlops/rlix#43.
This was referenced Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
miles half of rlops/rlix#42 (companion rlix PR: rlops/rlix#43 — full plan, evidence trail, and codex review history live there in
plans/miles-nccl-broadcast-plan.md).What
Sender-side NCCL for the F4
run_sync_sessionbroadcast path (previously a deliberateNotImplementedErrorguard with dead receiver-side code), plus the driver topology support the rlix transport modes need. Boundary: every change is in RLix-port-added code — zero pristine upstream lines touched (UpdateWeightFromDistributed,arguments.py,rlix_validation.py,sglang_engine.pyuntouched).Changes
megatron_utils/actor.py—_dispatch_nccl_broadcast/_run_sender_broadcast(mirrors the proven standaloneUpdateWeightFromDistributedordering):setup_collective_grouprefs async (no blocking get before the sender joins — rendezvous deadlock otherwise);TORCH_NCCL_ASYNC_ERROR_HANDLING/legacy alias is explicitly0);mem_get_info+ 1 GiB env-tunable margin, degrades to tensor-by-tensor — batching-only change) →dist.broadcastin metadata order under a cumulative transport deadline → receiver acks get the remaining window;finallyteardown on every exit path: cancel nested refs, receiver destroy fan-out (400-tolerant), senderdestroy_process_group. Budget hierarchy keeps worst-case unwind at 0.9× the service session deadline.ray/rollout.py—RolloutManager.register_router_if_active: atomic active-only router re-admission for the rlix sync-under-load bracket. State check + idempotent/add_workerinside one serialized manager call (manager is max_concurrency-1 ⇒ cannot interleave withshrink_engines); concurrently-shrunk engines are skipped, not raised on (deliberately avoids_resolve_engine_indices, whose liveness contract raises for exactly those).Drivers (user-directed topology support): per-pipeline invariant is now two-family —
train ⊆ infer(overlap/time-sharing, the tested M11 contract) or fully-disjoint (dedicated train cards ⇒ every engine NCCL-eligible); partial intersections stay rejected with an actionable error.run_miles_rlix.pyaddsMILES_SINGLE_TRAIN_GPUS/MILES_SINGLE_INFER_GPUSexplicit mappings (length-validated against the CLI-derived worker counts) — the minimal all-NCCL topology on 4 GPUs.Test plan
tests/test_nccl_broadcast_dispatch.py(16): dispatch ordering, receiver-failure abort, join-timeout budgets, stalled-transport cumulative deadline, preflight degradation, NCCL-watchdog env guardtests/test_register_router_if_active.py(4): contract on the real manager class — active-only, skip-not-raise, cheap empty probe, failure propagationtests/test_single_mapping_override.py(9): matching/undersized/oversized/duplicate/partial-intersection/subset/disjoint/half-set/legacytests/test_miles_pipeline.pyunchanged and greenNotes for reviewers
git difftouches only RLix-port sections (per-file rationale in the rlix PR's plan Appendix B).torchwhen broadcast +offload_trainare combined —preloadleaves stale cached allocator pointers at sender staging time.