-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Platforms] Add device_type
in Platform
#10508
Conversation
Signed-off-by: MengqingCao <cmq0113@163.com>
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
elif current_platform.is_xpu(): | ||
self.device_type = "xpu" | ||
else: | ||
self.device_type = current_platform.device_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will raise exception (attribute error) directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to set it in UnspecifiedPlatform
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you tell me in what cases UnspecifiedPlatform
would be called? I cannot confirm the device_type
of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will raise exception (attribute error) directly.
UnspecifiedPlatform
inherits from Platform
, thus I think this won't happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we install a cpu version pytorch in gpu environment (like arm64 chips, GH200), i think this will happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep the original error message raise RuntimeError("Failed to infer device type")
, but i'm afraid this will become an attribute after this pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your explanation, I got your point. Sorry for missing this case.
Signed-off-by: MengqingCao <cmq0113@163.com> Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
Signed-off-by: MengqingCao <cmq0113@163.com> Signed-off-by: Maxime Fournioux <55544262+mfournioux@users.noreply.github.com>
Signed-off-by: MengqingCao <cmq0113@163.com>
Part of #9268