Open
Conversation
Instead of only reporting rank 0's mean, gather timing from all ranks and report: - gpu_time_ms: max across ranks (true collective latency) - min_ms: fastest rank's median - skew_%: (max - min) / max * 100 — straggler penalty as percentage Per-rank summary uses median across iterations (robust to outliers). Cross-rank aggregation uses all_gather to collect every rank's median. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use CPU tensors for all_gather when backend is gloo instead of assuming CUDA. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the benchmark runner to report cross-rank timing statistics so the headline “GPU Time” reflects true collective latency (slowest rank), and exposes cross-rank variability via new counters.
Changes:
- Compute per-rank median iteration time and aggregate timing stats across ranks.
- Define “GPU Time” as max rank median, and compute bandwidth/TFLOPs from that value.
- Add
min_msandskew_%counters to quantify straggler impact.
Comment on lines
+433
to
+439
| # Cross-rank: gather every rank's median to compute | ||
| # max (true collective latency), min, and skew. | ||
| gather_device = "cuda" if backend == "nccl" else "cpu" | ||
| local_t = torch.tensor([local_median_ms], device=gather_device) | ||
| gathered = [torch.zeros(1, device=gather_device) for _ in range(world_size)] | ||
| dist.all_gather(gathered, local_t) | ||
| rank_medians = [t.item() for t in gathered] |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Comment on lines
+433
to
+442
| # Cross-rank: gather every rank's median to compute | ||
| # max (true collective latency), min, and skew. | ||
| gather_device = "cuda" if backend == "nccl" else "cpu" | ||
| local_t = torch.tensor([local_median_ms], device=gather_device) | ||
| gathered = [torch.zeros(1, device=gather_device) for _ in range(world_size)] | ||
| dist.all_gather(gathered, local_t) | ||
| rank_medians = [t.item() for t in gathered] | ||
|
|
||
| max_ms = max(rank_medians) | ||
| min_ms = min(rank_medians) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
iris/bench/_runner.py
Outdated
|
|
||
| counters = dict(state._counters) | ||
| counters["min_ms"] = min_ms | ||
| counters["skew_%"] = skew_pct |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Comment on lines
+436
to
+437
| local_t = torch.tensor([local_median_ms], device=gather_device) | ||
| gathered = [torch.zeros(1, device=gather_device) for _ in range(world_size)] |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Identifier-friendly key name for programmatic access (CSV/JSON). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
dist.all_gathercollects every rank's median to rank 0.GPU Timeis now max across ranks (the true collective latency — slowest rank determines when the operation is done).min_ms(fastest rank) andskew_%((max - min) / max * 100, straggler penalty as a percentage).Example output on MI308X ×8:
Test plan
bench_all_reduce.pyon MI308X ×8 with--axis_num_ranks=8 --axis_M=1024,4096 --axis_N=1024 --axis_dtype=bf16--axis_num_ranks=2,4,8to confirm multi-launch still works🤖 Generated with Claude Code