Add iris.bench benchmarking framework - #484
Merged
Merged
Conversation
Declarative framework that reduces benchmark boilerplate from ~350 lines to ~25 lines. Handles distributed init, parameter sweeps, timing via iris.do_bench(), and output formatting (console/JSON/CSV). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- num_ranks is a special axis that drives process spawning: the framework does a separate mp.spawn per unique value. Default 8 when no axis is declared. - Add --skip_<axis>=<values> CLI to exclude axis values (mirrors --axis_<axis>=<values> for overrides). - Remove -r/--num_ranks CLI flag and torchrun detection — the benchmark script is always a plain `python bench.py` invocation. - Rename shmem -> ctx in benchmark function signature. - Fix copyright to 2026 for new files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Explains the three phases (setup, preamble, timed kernel), that preamble_fn is not timed and can be heavyweight, how num_ranks drives process spawning, and CLI override/skip syntax. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Matches CI pattern (rdzv-endpoint=localhost:0). file:// rendezvous needs no port at all — uses a temp file for coordination, cleaned up after each spawn. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses torch.distributed.launcher.api.elastic_launch with c10d rendezvous on localhost:0 — same as CI's torchrun invocation. Eliminates: pickle temp files for result collection, file:// rendezvous, manual init_process_group parameters. Workers return results directly via elastic_launch's return value mechanism. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mawad-amd
marked this pull request as ready for review
March 26, 2026 03:48
Contributor
There was a problem hiding this comment.
Pull request overview
Adds iris.bench, a declarative distributed GPU benchmarking framework with axis sweeps, CLI overrides, and multi-format output.
Changes:
- Introduces core benchmark registry/types (
State, decorators, range helpers) and a distributed runner usingelastic_launch. - Adds console/JSON/CSV result formatting plus CLI parsing for axis overrides and skip filters.
- Includes a sample all-gather benchmark and exposes
iris.benchfrom the top-level package.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| iris/bench/_runner.py | Implements distributed execution, CLI parsing, and output formatting for benchmarks. |
| iris/bench/_core.py | Defines benchmark/state abstractions, registry, decorators, and axis-range helpers. |
| iris/bench/init.py | Public API exports and extensive usage documentation for the new framework. |
| iris/init.py | Exposes bench as a top-level iris submodule. |
| benchmark/examples/bench_all_gather.py | Demonstrates an all-gather benchmark written with iris.bench. |
3 tasks
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
iris.bench, a declarative GPU benchmarking framework inspired by NVBench and Google Benchmarkdo_bench(), and output formatting--axis_M=pow2:8:13), and skip filters (--skip_dtype=bf16)num_ranksis a special axis that controls process spawning viaelastic_launchbenchmark/examples/bench_all_gather.pyUsage
Test plan
--benchmark_out)🤖 Generated with Claude Code