Skip to content

Detect ROCm builds without requiring a visible GPU - #512

Open
kashif wants to merge 1 commit into
rusty1s:masterfrom
kashif:rocm-build-gating
Open

Detect ROCm builds without requiring a visible GPU#512
kashif wants to merge 1 commit into
rusty1s:masterfrom
kashif:rocm-build-gating

Conversation

@kashif

@kashif kashif commented Aug 20, 2026

Copy link
Copy Markdown

setup.py gates the HIP extension build on torch.cuda.is_available(), which is False on any machine without a visible GPU — including CI wheel builders. On a ROCm build of PyTorch that silently produces a CPU-only wheel, and it also skips the include_package_data work-around that's there specifically for hipify's absolute paths.

Both checks now key off torch.version.hip, which describes the PyTorch build rather than the machine doing the building. CUDA behaviour is unchanged.

Tested on ROCm 7.2 / gfx1150 with PyTorch 2.13: builds from source and the test suite passes (2771 passed, 30 skipped — the skips are all multi-GPU).

Signed-off-by: Kashif Rasul <kashif.rasul@gmail.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.20%. Comparing base (140d3ad) to head (69b5777).
⚠️ Report is 24 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #512      +/-   ##
==========================================
+ Coverage   97.23%   98.20%   +0.97%     
==========================================
  Files          10       10              
  Lines         217      223       +6     
==========================================
+ Hits          211      219       +8     
+ Misses          6        4       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants