-
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] Broke out implicit device requirements into SPIRVSupport #8048
[Vulkan] Broke out implicit device requirements into SPIRVSupport #8048
Conversation
25c0dad
to
6a13b44
Compare
@masahi In the new |
src/target/spirv/spirv_support.h
Outdated
* then this value will be set to 0. | ||
* | ||
*/ | ||
uint32_t supportedSubgroupOperations{0}; |
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.
note: stl_style to be consistent with the rest of the codebase
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.
Thank you, and I will change the names. I had been attempting to have the names here mimic the names of the spirv/vulkan features that they enable, but I can see how that would be inconsistent elsewhere.
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.
Member variable names have been updated, along with adding additional documentation on where they should be derived from on the vulkan side.
namespace codegen { | ||
|
||
/*! \brief Represents which support a Vulkan driver has that are relevant to codegen */ | ||
struct SPIRVSupport { |
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.
One thing to keep in mind is the need of cross compilation, e.g. the machine that runs compilation may not be the machine that executes the program. So we cannot do simple live query on the driver on the same machine.
It would be good to list the some attributes of interest and register them directly in the vulkan.
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.
Agreed, and that is my plan for the next steps. My plan is to have many of these parameters be added to the TVM_REGISTER_TARGET_KIND
for vulkan, both to pass them through to the codegen, and in the future to expose them to the optimization passes.
6a13b44
to
09a961d
Compare
Probably we need more fine-grained information than yes/no result. Vulkan has (surprisingly) wide variety of subgroup op support as described in https://www.khronos.org/blog/vulkan-subgroup-tutorial. For prefix scan, it is probably enough to have Since this is a complicated issue, we can add support for them on a need basis later. So feel free to drop |
I think the bitflags from the |
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, there was a CI issue, please retrigger
Codifies the current requirements that are implicit in the shaders built by CodeGenSPIRV (e.g. can read from 8-bit buffers). The next steps for this development are (1) to query driver/device support information from the device, (2) to pass these query parameters through the Target, and (3) to ensure correct shader generation even when features are not supported. Step (3) will require exposing the target properties to relay optimization passes.
09a961d
to
43db690
Compare
…ache#8048) Codifies the current requirements that are implicit in the shaders built by CodeGenSPIRV (e.g. can read from 8-bit buffers). The next steps for this development are (1) to query driver/device support information from the device, (2) to pass these query parameters through the Target, and (3) to ensure correct shader generation even when features are not supported. Step (3) will require exposing the target properties to relay optimization passes. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
…ache#8048) Codifies the current requirements that are implicit in the shaders built by CodeGenSPIRV (e.g. can read from 8-bit buffers). The next steps for this development are (1) to query driver/device support information from the device, (2) to pass these query parameters through the Target, and (3) to ensure correct shader generation even when features are not supported. Step (3) will require exposing the target properties to relay optimization passes. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
Codifies the current requirements that are implicit in the shaders
built by CodeGenSPIRV (e.g. can read from 8-bit buffers). The next
steps for this development are (1) to query driver/device support
information from the device, (2) to pass these query parameters
through the Target, and (3) to ensure correct shader generation even
when features are not supported.
Step (3) will require exposing the target properties to relay
optimization passes.