[Ansor] Add HW param for Vulkan tuning#7626
Merged
Merged
Conversation
FrozenGene
reviewed
Mar 10, 2021
| device_api->GetAttr(ctx, tvm::runtime::DeviceAttrKind::kWarpSize, &ret); | ||
| int warp_size = ret; | ||
|
|
||
| int max_vthread_extent = warp_size / 4; |
Member
There was a problem hiding this comment.
Does warp_size have the possibility to be 1?
Member
Author
There was a problem hiding this comment.
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).
tmoreau89
approved these changes
Mar 11, 2021
Contributor
|
I have reproduced it on a AMD GPU machine and it is reporting the warp/wave size (64) correctly - thanks! |
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
* add HW param for VK * query warp size properly * guard against warp_size < 4 case Co-authored-by: Masahiro Masuda <masahi@129@gmail.com>
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
May 11, 2021
* 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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