Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.

fix: properly gate usage of torch.cuda.device_count (backport #3358)#3359

Merged
mergify[bot] merged 1 commit intorelease-v0.26from
mergify/bp/release-v0.26/pr-3358
May 5, 2025
Merged

fix: properly gate usage of torch.cuda.device_count (backport #3358)#3359
mergify[bot] merged 1 commit intorelease-v0.26from
mergify/bp/release-v0.26/pr-3358

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented May 5, 2025

since we support HPU and ROCm for inference, we need to gate torch.cuda.device_count since on HPU specificially this will cause issues.

use similar logic as we do in init.py to ensure CUDA is available, and HPU/ROCm are not.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the
    conventional commits.
  • Changelog updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Functional tests have been added, if necessary.
  • E2E Workflow tests have been added, if necessary.

This is an automatic backport of pull request #3358 done by [Mergify](https://mergify.com).

since we support HPU and ROCm for inference, we need to gate torch.cuda.device_count since on HPU specificially this will cause issues.

use similar logic as we do in `init.py` to ensure CUDA is available, and HPU/ROCm are not.

Signed-off-by: Charlie Doern <[email protected]>
(cherry picked from commit 9b05e24)
@mergify mergify Bot added the release-branch Pull Request directly to a release branch label May 5, 2025
@mergify mergify Bot added the one-approval PR has one approval from a maintainer label May 5, 2025
@mergify mergify Bot added ci-failure PR has at least one CI failure and removed one-approval PR has one approval from a maintainer ci-failure PR has at least one CI failure labels May 5, 2025
@mergify mergify Bot merged commit 1be4761 into release-v0.26 May 5, 2025
27 checks passed
@mergify mergify Bot deleted the mergify/bp/release-v0.26/pr-3358 branch May 5, 2025 17:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-branch Pull Request directly to a release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants