Fix bench CLI validation, set_device guard, and docs - #485
Merged
Conversation
… docs - Guard torch.cuda.set_device() behind CUDA availability check - Validate pow2:/lin: axis format and dtype names with clear errors - Iterate combos lazily instead of materializing full cartesian product - Fix skipped-row rendering for benchmarks with zero param columns - Fix docstring: mp.spawn() -> elastic_launch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Improves the benchmarking CLI’s robustness and usability by adding safer device initialization, clearer axis/dtype validation errors, and more efficient parameter iteration, plus a small documentation correction.
Changes:
- Add explicit validation for
pow2:/lin:axis specifications and unknown dtype names. - Avoid
torch.cuda.set_device()on CPU-only environments and iterate axis combinations lazily. - Fix console formatting for skipped benchmarks with no parameter columns; update docs to match
elastic_launch.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| iris/bench/_runner.py | CLI validation improvements, CPU-safe CUDA init, lazy cartesian product, and console rendering fix. |
| iris/bench/init.py | Docstring updated to reference elastic_launch instead of mp.spawn(). |
…s, skip row edge case 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
torch.cuda.set_device()behindtorch.cuda.is_available()to avoid crash on CPU-only envspow2:/lin:axis format and dtype names with clear error messages instead of IndexError/KeyErrormp.spawn()when implementation useselastic_launchAddresses Copilot review comments from #484.
Test plan
--axis_dtype=float17gives clear errorpow2:8gives clear error🤖 Generated with Claude Code