Lunderberg opened a new pull request #8127:
URL: https://github.com/apache/tvm/pull/8127


   The end-to-end goal of this PR is to be able to specify all vulkan 
capabilities in the Target, initialize vulkan such that we can legally use 
those capabilities, then pass the device description to the SPIRVSupport 
struct.  This is broken down into the following subchanges, each of which is 
implemented in a separate commit for readability.
   
   - Enable instance/device extensions.  Vulkan requires that extensions be 
explicitly enabled if used.  Has explicitly list out which extensions are 
required (currently none) and which are optional.
   
   - Extract device information using `vkGetPhysicalDeviceProperties` and 
`vkGetPhysicalDeviceFeatures`, determine which Vulkan capabilities are 
supported, pack into a Target.
   
   - Query instance-supported apiVersion before creating instance. Vulkan 
requires no functions beyond the specified apiVersion be used.
   
   - Query support for dedicated allocation and push descriptors along with the 
rest of the device support.  Move the options to disable their use from 
compile-time variables to environment variables 
`TVM_VULKAN_DISABLE_PUSH_DESCRIPTOR` and 
`TVM_VULKAN_DISABLE_DEDICATED_ALLOCATION`.
   
   - Move option for vulkan validation layers to environment variable, to 
enable faster use as a debug tool.  If `TVM_VULKAN_ENABLE_VALIDATION_LAYERS` is 
a non-empty string, validation layers will be enabled.
   
   - Explicitly enable vulkan features in device creation.  Vulkan requires 
that features be explicitly enabled before use.  For each feature that the 
device supports and a shader might use, declare it in the call to 
`vkCreateDevice`.
   
   - Avoid repeated queries for device attributes, implementing 
`VulkanDeviceAPI::GetAttr` based on the per-device values stored in the Target. 
 This pulls all logic for querying device parameters is in a single location.
   
   - Implement "from_device" flag for the vulkan target.  With the number of 
device capabilities that may or may not be supported by a vulkan driver, it can 
be tedious to input them.  Specifying "-from_device=0" now indicates that any 
unspecified values should be read from the device.
   
   - Read vulkan device capabilities/limits from Target.  Previously, the 
codegen assumed that all device features were present.  Now, the codegen reads 
device capabilities from the Target, and throws an error if codegen would 
require use of an unsupported feature.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to