bench: add generic weight-sync policy sweep - #2354
Open
0z5a wants to merge 3 commits into
Open
Conversation
Benchmark trainer-to-engine NCCL broadcast and P2P synchronization across bucket credits, engine waves, and phase strides. Support arbitrary homogeneous or heterogeneous engine-group layouts and report slowest-rank latency, component timings, inflight bytes, skew, and optional traces. Assisted-by: OpenAI Codex Signed-off-by: jiachun <2609024259@qq.com>
Record the maximum number of engine groups present in each generated wave so benchmark results can validate all-at-once, serialized, and windowed policies directly. Assisted-by: OpenAI Codex Signed-off-by: jiachun <2609024259@qq.com>
Signed-off-by: 0z5a <dinadegttyarenko6@gmail.com>
0z5a
marked this pull request as ready for review
September 7, 2026 09:36
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.
Draft update — 2026-09-05
Adds fail-closed timing provenance to the benchmark. Historical 2/4-rank results below demonstrate benchmark execution, not production engine loading or a universal speedup.
AI assistance: OpenAI Codex. Remains Draft; implementation, CPU/Gloo checks and production GPU validation are separate acceptance gates. No new GPU results were generated during publication.
The original submission description and validation history follow.
Summary
torch.distributedbenchmark for trainer-to-rollout-engine weight synchronizationScope: benchmark only
This PR adds only
tools/benchmark_weight_sync.pyandtests/test_weight_sync_benchmark.py. It does not modify slime's production weight updater, Ray/SGLang lifecycle, or select a runtime scheduling policy.all_at_once,windowed, andserializedare controlled benchmark scenarios for measuring tradeoffs, not new production defaults or policy decisions.General topology support
Rank 0 is the trainer and all remaining launched ranks are derived into logical engine groups. Homogeneous groups use
--engine-group-size; heterogeneous layouts use--engine-group-sizes, whose sum must cover every non-trainer rank exactly once. The implementation supports any valid world size of at least two and contains no hard-coded five-rank, six-rank, or other topology special case.Each logical engine receives its own trainer-plus-engine data and Gloo control groups, so TP/PP-style multi-rank and heterogeneous groups can be represented without changing the benchmark core.
Validation and evidence
nccl_broadcastandp2p, covering the minimum valid trainer-plus-one-engine topology.nccl_broadcast,p2p), two message sizes (16 MiB, 64 MiB), bucket credits 1/2, all three engine-wave policies, and phase strides 0/500 us, with 2 warmups and 10 measured iterations per configuration.git diff --checkpasses for both commits.These numbers demonstrate benchmark execution and policy observability; they are not a claim that one policy is universally faster. The engine-load stage is a synthetic device-to-device copy, and the benchmark intentionally excludes a real model plus Ray/SGLang lifecycle. Production decisions require repeating the matrix on the target topology and workload.
Duplicate check
I searched current open issues and PRs for weight-sync benchmarks, communication-phase benchmarks, policy sweeps, and the exact benchmark filename. No substantive duplicate was found. #2351 and #2352 are related runtime proposals; this PR remains an independent, policy-neutral measurement tool and does not depend on or include either implementation.
AI assistance and required review
This implementation, tests, commit messages, and PR text were prepared with OpenAI Codex assistance. A human contributor/maintainer must review every changed line, validate the synchronization and timing methodology, and reproduce the relevant 2-rank and 4-rank evidence before this draft is considered ready to merge.