Skip to content

[global, cli] fix: validate visible gpu ordinals - #83

Merged
Wangmerlyn merged 1 commit into
mainfrom
codex/visible-gpu-id-validation
Jun 27, 2026
Merged

[global, cli] fix: validate visible gpu ordinals#83
Wangmerlyn merged 1 commit into
mainfrom
codex/visible-gpu-id-validation

Conversation

@Wangmerlyn

Copy link
Copy Markdown
Owner

Summary

  • Keep blocking-mode --gpu-ids as visible ordinals without rewriting CUDA_VISIBLE_DEVICES.
  • Validate explicit CUDA/ROCm gpu_ids against the current visible device count before constructing keep workers.
  • Update CLI help, README, AGENTS.md, and docs to describe visible-ordinal semantics and service-process environment behavior.

Verification

  • git diff --check HEAD~1..HEAD
  • PYTHONPATH=$PWD/src pytest tests/test_cli_thresholds.py tests/global_controller tests/mcp tests/utilities/test_gpu_monitor.py -q (100 passed, 1 skipped)
  • PYTHONPATH=$PWD/src pytest tests -q (190 passed, 12 skipped)
  • PYTHONPATH=$PWD/src mkdocs build
  • pre-commit run --all-files

Local Review

  • Euclid local subagent review found no Critical or Important issues.
  • The dashboard/list-gpus physical-ID label ambiguity is intentionally left for a separate one-issue branch.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Wangmerlyn, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 1 minute and 40 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 23258550-afaf-473d-a1ec-87e809da4df3

📥 Commits

Reviewing files that changed from the base of the PR and between ea8eb95 and 0519b6c.

📒 Files selected for processing (15)
  • AGENTS.md
  • README.md
  • docs/concepts/architecture.md
  • docs/getting-started.md
  • docs/guides/cli.md
  • docs/guides/mcp.md
  • docs/guides/python.md
  • docs/plans/visible-gpu-id-validation.md
  • docs/reference/api.md
  • docs/reference/cli.md
  • src/keep_gpu/cli.py
  • src/keep_gpu/global_gpu_controller/global_gpu_controller.py
  • src/keep_gpu/mcp/server.py
  • tests/global_controller/global_keep_test.py
  • tests/test_cli_thresholds.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/visible-gpu-id-validation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request implements early validation of visible GPU ordinals (gpu_ids) against the available device count and removes the automatic mutation of CUDA_VISIBLE_DEVICES in the blocking CLI mode. It updates documentation across various guides, plans, and reference files to clarify that gpu_ids represent visible device ordinals after any environment-level filtering. Additionally, new unit tests are introduced to verify that invalid GPU IDs are rejected early and that CUDA_VISIBLE_DEVICES remains unmodified during execution. I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Wangmerlyn
Wangmerlyn merged commit 654c59f into main Jun 27, 2026
5 checks passed
@Wangmerlyn
Wangmerlyn deleted the codex/visible-gpu-id-validation branch June 27, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant