-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Ansor] Add HW param for Vulkan tuning #7626
Conversation
src/auto_scheduler/search_task.cc
Outdated
device_api->GetAttr(ctx, tvm::runtime::DeviceAttrKind::kWarpSize, &ret); | ||
int warp_size = ret; | ||
|
||
int max_vthread_extent = warp_size / 4; |
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.
Does warp_size
have the possibility to be 1
?
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.
A good catch, indeed the spec only requires warp size to be greater than or equal to 1. In practice it is always greater than 1, but I'll update this to int max_vthread_extent = std::max(1, warp_size / 4)
.
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.
fixed
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
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 @masahi LGTM!
I have reproduced it on a AMD GPU machine and it is reporting the warp/wave size (64) correctly - thanks! |
* add HW param for VK * query warp size properly * guard against warp_size < 4 case Co-authored-by: Masahiro Masuda <masahi@129@gmail.com>
* add HW param for VK * query warp size properly * guard against warp_size < 4 case Co-authored-by: Masahiro Masuda <masahi@129@gmail.com>
This introduces support for VK backend in ansor. Also added a proper way to query the warp size using VK api, since it can be different for each platform (AMD uses 64 while others 32 etc).
please review @comaniac @FrozenGene @merrymercy @tmoreau89