Skip to content

fix: validate gpu counts and custom vram capacities - #51

Open
rupayon123 wants to merge 4 commits into
pipe1os:mainfrom
rupayon123:contribution/gpu-target-validation-20260909
Open

rupayon123 wants to merge 4 commits into
pipe1os:mainfrom
rupayon123:contribution/gpu-target-validation-20260909

Conversation

@rupayon123

Copy link
Copy Markdown
Contributor

Summary

Reject zero GPU counts and nonpositive/non-finite custom VRAM capacities. Previously 0x RTX4090 produced a zero-device target, nan/inf entered memory estimates, and -1 was normalized to positive 1 before parsing.

Parse numeric capacity from the unnormalized target while retaining the existing vendor-name and hyphen normalization for known GPU names.

Type of Change

  • Bug fix

How Has This Been Tested?

Eight invalid-target cases failed before the fix. Three valid target cases confirm fractional capacities, multi-GPU capacities, and hyphenated GPU names still work. Full suite: 75 passed on Python 3.11. ruff check tests/test_gpu_target_validation.py and git diff --check pass.

Checklist

  • Conventional commit with How to test instructions.
  • New regressions and existing tests pass locally.
  • No hardware access or extra dependency needed for the tests.

Prepared with AI assistance and tested locally.

How to test: python -m pytest -q (75 passed); eight invalid target cases failed before the fix.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2a64a619-df79-4394-b125-33be679c3554


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.

@codacy-production

codacy-production Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 critical · 2 medium

Alerts:
⚠ 4 issues (≤ 0 issues of at least minor severity)

Results:
4 new issues

Category Results
Security 2 critical
2 medium

View in Codacy

🟢 Metrics 10 complexity · 0 duplication

Metric Results
Complexity 10
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@rupayon123

Copy link
Copy Markdown
Contributor Author

Additional fixes pushed to this branch:

  • bd5703e: Read ROCm device-prefixed memory totals.
  • e40cc03: Prevent Intel Macs being labeled Apple Silicon unified GPU memory.
  • f7930e7: Reject malformed Intel GPU capacity values and convert TiB.

All 84 local tests pass. ROCm and Intel cases use command-output fixtures. The Apple Silicon capability probe was also checked on this Mac; this does not validate an actual GPU allocation or the memory availability heuristic.

Prepared with AI assistance. Changes are submitted for review; this is not a claim of maintainer approval.

This branch has not been deployed

No deployments
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