Skip to content

Fix bench CLI validation, set_device guard, and docs - #485

Merged
mawad-amd merged 4 commits into
mainfrom
muhaawad/fix-bench-review-comments
Mar 26, 2026
Merged

Fix bench CLI validation, set_device guard, and docs#485
mawad-amd merged 4 commits into
mainfrom
muhaawad/fix-bench-review-comments

Conversation

@mawad-amd

Copy link
Copy Markdown
Collaborator

Summary

  • Guard torch.cuda.set_device() behind torch.cuda.is_available() to avoid crash on CPU-only envs
  • Validate pow2:/lin: axis format and dtype names with clear error messages instead of IndexError/KeyError
  • Iterate parameter combos lazily instead of materializing full cartesian product
  • Fix skipped-row console rendering for benchmarks with zero param columns
  • Fix docstring referencing mp.spawn() when implementation uses elastic_launch

Addresses Copilot review comments from #484.

Test plan

  • Existing bench tests pass
  • Manual: --axis_dtype=float17 gives clear error
  • Manual: pow2:8 gives clear error

🤖 Generated with Claude Code

… 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>
Copilot AI review requested due to automatic review settings March 26, 2026 04:43
@mawad-amd
mawad-amd requested review from BKP and neoblizz as code owners March 26, 2026 04:43
@github-actions github-actions Bot added in-progress We are working on it iris Iris project issue labels Mar 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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().

Comment thread iris/bench/_runner.py
Comment thread iris/bench/_runner.py Outdated
Comment thread iris/bench/_runner.py Outdated
mawad-amd and others added 2 commits March 25, 2026 21:51
…s, skip row edge case

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mawad-amd
mawad-amd merged commit 78adb06 into main Mar 26, 2026
@mawad-amd
mawad-amd deleted the muhaawad/fix-bench-review-comments branch March 26, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-progress We are working on it iris Iris project issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants