Repository navigation
[ROCm] Count Windows ROCm GPUs with hipInfo - #193594
chinmaydk99 wants to merge 5 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/193594
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (4 Unrelated Failures)As of commit 95dcc53 with merge base f07882e ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
bd4d0f7 to
81aaffc
Compare
|
|
81aaffc to
c4e257a
Compare
| if IS_ROCM and not IS_MEM_LEAK_CHECK and os.name == "nt": | ||
| NUM_PROCS = 1 |
There was a problem hiding this comment.
FYI there are options other than rocminfo to get GPU info:
- https://github.com/ROCm/TheRock#discovering-available-targets-on-your-system
- https://pypi.org/project/rocm-bootstrap/ (we can publish a new package version that includes ROCm/rocm-systems@5a8a42a for it to work on Windows)
rocminfo is also coming to Windows, see the flag: https://github.com/ROCm/TheRock/blob/7c4f91fd9f64791276d402830741c760d11bb2d8/FLAGS.cmake#L91-L95
There was a problem hiding this comment.
Thank you for sharing this. I'll go through this and check whether there exists a suitable alternative to the current approach
Windows ROCm test discovery fails at import because rocminfo is not available. Use the safe serial worker count on Windows while preserving rocminfo GPU discovery on other ROCm runners. Test Plan: ``` wsl.exe -d Ubuntu -- ssh -o BatchMode=yes smci355-1b112-b12-23.mnb.dcgpu "docker exec -w /tmp/ck-windows-nightly-lint-644154d cdk-rocm-10 /opt/venv/bin/spin lint" ``` This commit was prepared with assistance from an AI coding assistant. Co-authored-by: Cursor <[email protected]>
Windows ROCm test discovery crashes at import because rocminfo is absent and FileNotFoundError was uncaught. Query hipInfo first on Windows; gcnArchName lines match the existing " gfx" GPU count. Fall back to rocminfo, then to serial NUM_PROCS=1 if the tool is missing or fails. Test Plan: ``` wsl.exe -d Ubuntu -- ssh -o BatchMode=yes smci355-1b112-b12-23.mnb.dcgpu "docker exec -w /tmp/ck-windows-probes cdk-rocm-10 /opt/venv/bin/spin lint" ``` This commit was prepared with assistance from an AI coding assistant.
619faa2 to
9a6375b
Compare
Three fixes to the hipInfo/rocminfo loop: a command that runs but yields zero gfx lines now advances to the next command instead of raising mid-chain (which reproduced the import crash this PR fixes and skipped rocminfo); the loud there-must-be-a-GPU health check fires only after every available tool ran and saw nothing, with the serial default reserved for no tool being present; output decoding is utf-8 with errors=replace since hipInfo prints driver marketing names that need not be ASCII. Also drops the stale common.yml.j2 comment (that template no longer carries rocminfo logic).
There was a problem hiding this comment.
Approving. The hipInfo-then-rocminfo chain is the right stopgap until rocminfo ships on Windows via TheRock.
I pushed two maintainer commits: a viable/strict merge, and a hardening of the fallback chain. The count == 0 AssertionError previously sat inside the per-command try but was not caught, so a hipInfo that ran and printed no gfx lines crashed run_test.py at import (the exact failure this PR fixes) without ever trying rocminfo. Now a zero-yield command advances the chain, the there-must-be-a-GPU health check fires only after every available tool ran and saw nothing, the serial default applies when no tool exists, and decoding is utf-8 with errors=replace since hipInfo prints driver marketing names. Validated locally: a real rocminfo host counts correctly, and all fallback paths were exercised standalone.
The four previous red CI shards are unrelated (trunk-matched or no causal path from this change). But viable/strict push is rerunning CI anyway.
Analysis assisted by AI.
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: periodic-rocm-mi200 / linux-jammy-rocm-py3.10-mi200 / test (distributed, 3, 3, linux.rocm.gpu.mi210.2, module:rocm, oncall:distributed) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
PR pytorch#188593 sets `IS_ROCM` from `torch.version.hip`. Import of `tools/testing/test_selections.py` then runs `rocminfo` to set `NUM_PROCS`. The Windows nightly job in ROCm/TheRock#7155 does not have `rocminfo` on PATH. `subprocess.check_output` raises `FileNotFoundError`, and `test/run_test.py` stops before any test starts. This change keeps the current count method: count output lines that contain `" gfx"`. On Windows the first command is `hipInfo`. Each HIP device prints a `gcnArchName` line that contains `" gfx"`, so the count uses the same rule as Linux. If `hipInfo` is missing or returns a non-zero exit code, the code runs `rocminfo`. On Linux the code runs `rocminfo` only. If the command is missing or returns a non-zero exit code, `NUM_PROCS` is set to `1` and import continues. This change does not disable GPU counting on Windows when `hipInfo` is present. This change does not use `torch.cuda.device_count()` for `NUM_PROCS`. Pull Request resolved: pytorch#193594 Approved by: https://github.com/jeffdaily Co-authored-by: Cursor <[email protected]> Co-authored-by: Jeff Daily <[email protected]>
…93594) (#3661) PR pytorch#188593 sets `IS_ROCM` from `torch.version.hip`. Import of `tools/testing/test_selections.py` then runs `rocminfo` to set `NUM_PROCS`. The Windows nightly job in ROCm/TheRock#7155 does not have `rocminfo` on PATH. `subprocess.check_output` raises `FileNotFoundError`, and `test/run_test.py` stops before any test starts. This change keeps the current count method: count output lines that contain `" gfx"`. On Windows the first command is `hipInfo`. Each HIP device prints a `gcnArchName` line that contains `" gfx"`, so the count uses the same rule as Linux. If `hipInfo` is missing or returns a non-zero exit code, the code runs `rocminfo`. On Linux the code runs `rocminfo` only. If the command is missing or returns a non-zero exit code, `NUM_PROCS` is set to `1` and import continues. This change does not disable GPU counting on Windows when `hipInfo` is present. This change does not use `torch.cuda.device_count()` for `NUM_PROCS`. Pull Request resolved: pytorch#193594 Approved by: https://github.com/jeffdaily Co-authored-by: Chinmay Kuchinad <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: Jeff Daily <[email protected]> Co-authored-by: Artem Kuzmitckii <[email protected]>
PR #188593 sets
IS_ROCMfromtorch.version.hip. Import oftools/testing/test_selections.pythen runsrocminfoto setNUM_PROCS. The Windows nightly job in ROCm/TheRock#7155 does not haverocminfoon PATH.subprocess.check_outputraisesFileNotFoundError, andtest/run_test.pystops before any test starts.This change keeps the current count method: count output lines that contain
" gfx". On Windows the first command ishipInfo. Each HIP device prints agcnArchNameline that contains" gfx", so the count uses the same rule as Linux. IfhipInfois missing or returns a non-zero exit code, the code runsrocminfo. On Linux the code runsrocminfoonly. If the command is missing or returns a non-zero exit code,NUM_PROCSis set to1and import continues.This change does not disable GPU counting on Windows when
hipInfois present. This change does not usetorch.cuda.device_count()forNUM_PROCS.cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang