Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hardware][cuda] use device id under CUDA_VISIBLE_DEVICES for get_device_capability #6216

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

youkaichao
Copy link
Member

fixes #6213

Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable, thanks for quick fix!

@comaniac
Copy link
Collaborator

comaniac commented Jul 8, 2024

Should we replace all usages of torch.cuda.get_device_capability() with this? For example attention selector and ROCm attention now still use the native torch one, which may result in the same issue.

@youkaichao
Copy link
Member Author

Should we replace all usages of torch.cuda.get_device_capability() with this? For example attention selector and ROCm attention now still use the native torch one, which may result in the same issue.

I replaced most of them in #6080 . The rest are mostly used under is_hip, and they still use torch.cuda.get_device_capability() . In rocm, this function does not initialize device.

@mgoin
Copy link
Member

mgoin commented Jul 8, 2024

@youkaichao I forget where but I ran into CI issues with current_platform.get_device_capability() hitting an exception on CPU tests because current_platform returns as None in that case. Should we make better dummy behavior for CPU/non-supported platforms, such as returning 0?

@youkaichao
Copy link
Member Author

I forget where but I ran into CI issues with current_platform.get_device_capability() hitting an exception on CPU tests because current_platform returns as None in that case.

links would be appreciated. I don't think cpu code should call this function. even before this change, torch.cuda.get_device_capability() would also error out in cpu case.

@comaniac
Copy link
Collaborator

comaniac commented Jul 8, 2024

@youkaichao
Copy link
Member Author

@comaniac these should be called after process initialize cuda, so they are fine. we can also replace them, though.

@comaniac
Copy link
Collaborator

comaniac commented Jul 8, 2024

@comaniac these should be called after process initialize cuda, so they are fine. we can also replace them, though.

Yeah it would be safer to replace this one as well.

Copy link

@T-Atlas T-Atlas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@comaniac comaniac merged commit a3c9435 into vllm-project:main Jul 9, 2024
70 checks passed
@comaniac
Copy link
Collaborator

comaniac commented Jul 9, 2024

Merge first. I'll change the use in selector in another PR.

@youkaichao youkaichao deleted the capability branch July 9, 2024 03:32
dtrifiro pushed a commit to opendatahub-io/vllm that referenced this pull request Jul 17, 2024
xjpang pushed a commit to xjpang/vllm that referenced this pull request Jul 24, 2024
Alvant pushed a commit to compressa-ai/vllm that referenced this pull request Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants