-
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
[SPIR-V] Fix pushconstants offset calculation for 32 bit values #7620
Merged
Conversation
This file contains 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
masahi
changed the title
[SPIR-V] Fix pushconstants offset calculation for 32 bit and mixed 32 / 64 bit constants
[SPIR-V] Fix pushconstants offset calculation for 32 bit values
Mar 9, 2021
tqchen
approved these changes
Mar 9, 2021
masahi
force-pushed
the
fix-vk-pushconstants-offset
branch
from
March 9, 2021 19:19
98d618b
to
d7f983c
Compare
Replaced dynamic cumsum test with dynamic argsort, since our GPU cumsum seems to have issues with dynamic input in general (doesn't work on rocm either). The dynamic argsort also exercises mixed 64 and 32 bit pushconstants. |
masahi
force-pushed
the
fix-vk-pushconstants-offset
branch
from
March 9, 2021 21:36
c3b8c96
to
4b1d615
Compare
masahi
force-pushed
the
fix-vk-pushconstants-offset
branch
from
March 10, 2021 01:50
4b1d615
to
815255c
Compare
Thanks @tqchen |
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…he#7620) * Fix push constant offset for 32 bit value * add test * remove unused function from test * add dynamic cumsum test * skip if vulkan is not enabled * replace dynamic cumsum test with dynamic argsort for now Co-authored-by: Masahiro Masuda <masahi@[email protected]>
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
May 11, 2021
…he#7620) * Fix push constant offset for 32 bit value * add test * remove unused function from test * add dynamic cumsum test * skip if vulkan is not enabled * replace dynamic cumsum test with dynamic argsort for now Co-authored-by: Masahiro Masuda <masahi@[email protected]>
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.
I found a cool bug from #7572: It only works when pushconstants are one or more 64 bit values. #7572 didn't change the codegen but load offset needs to be adjusted for 32 bit values (since all pushconstants occupy 64 bit after #7572). In particular, dynamic shape workload requires passing the shape size as 32 bit pushconstants, so currently VK/SPIR-V backend is completely broken for dynamic shape.
I updated load offset calculation and now dynamic shape started working with VK/SPIR-V. Dynamic shape sort, which involves mixed 32 and 64 bit pushconstants, is also working using a patch from #7607. But one test I added, dynamic cumsum, is still not working for some reason.
cc @tqchen @vinx13 I'm not sure if Metal backend has this problem.