-
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
[Vulkan] Remove some interface block decoration #8102
Conversation
Wow!! I can confirm that gemm, conv2d, and sorting all work on linux + nv vulkan with this patch, thank you very much!! I've been thinking that the error on nv was a driver issue, very glad to know that this is our bug 🙂 I'm going to test on intel and RADV mesa driver, both of which have had problems with TVM vk. Just curious, how did you figure out this? |
It's good luck. I found that, if I do not use I also translated TVM generated spv code to glsl code with spirv-cross, but the glsl code could not be compiled back to spv because that the type definitions of shared variables were missed. Then I corrected the glsl code and compiled it to spv. So I got two spv files, one from TVM and the other from valid glsl. I compared their spirv IR, especially parts related to shared memory (workgroup variable). Conclusively, glsl-generated code lacks the I'm not familiar with Vulkan, so I'm not sure if this patch is good enough. @masahi do you have any suggestions? |
One suggestion, I think we should need to apply the General notes from reading over changes, and re-reading documentation for similar issues:
|
Thanks @llehtahw, that's really great debugging technique! And thanks @Lunderberg on array stride. Indeed the spec says very explicitly that |
@Lunderberg If I make this change,
I get this error
Looking at the spec sentence, I wonder what exactly |
I get reproduce the same validation error, and I'll look into it on my end. I think that an "array that contains a structure" would be the a type declared with |
Found it! I was mistaken on the ordering. The output is a struct that contains an array, not an array consisting of structs. The struct receives Sorry for accidentally sending you down a rabbit hole, and everything in the PR looks good to me. |
Thanks @llehtahw again for the great work, and @Lunderberg for the review!! |
Thanks @masahi for testing. And thanks @Lunderberg for comments, learned a lot from your notes! |
* Remove block decorator for shared/local variables * Fix lint
* Remove block decorator for shared/local variables * Fix lint
From spir-v decoration
And interface block(GLSL)
I guess that
StructArrayType
s of shared memory (or shared variables in GLSL) and local memory are not required to be decorated withBlock
.After applying this patch, this issue seems solved to me.