You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ET-VK] additional dtype runtime support along with their aliases
Pull Request resolved: #11365
# Context
This diff generally aims provide improvements to the existing framework for defining dtype GLSL shader variants, along with setting up support that would be necessary for future shader implementations that wish to support int64 and double dtypes. In order to allow doubles as input/output dtypes for dequantization and quantization, this diff will create the dtype runtime support on the Vulkan backend in Executorch by establishing the relationship between different tensor types and different GLSL types.
# Changes
The main changes are included in `gen_vulkan_spv.py` which maps the relationship between different dtypes and their GLSL types. For instance, we add aliases for every common dtype which includes `uint8`, `int8`, `uint16`, `int16`, `uint32`, `int32`, `uint64`, `int64`, and `double`. We maintain support for `int`, `uint`, and `bool` alises such that we can avoid making the change overly complex while supporting the most common recognizable alias (int). Furthermore, this diff also modifies the vulkan api to incorporate new types, namely `uint32_t`, `double`, the int16 and int64 variants. We then make sure that the `ShaderNameUtils` (which is commonly used by most operators for creating their variant names), utilizes the new aliasing. Beyond that we also throw an exception to disallow YAML files to include just "int", and to be more specific, like with "int32".
We then modify dozens of files to switch to the new alias of int32. Furthermore, we also include double in certain shaders that are used as intermediaries for image to buffer to nchw converisons.
ghstack-source-id: 290376491
@exported-using-ghexport
Differential Revision: [D75959063](https://our.internmc.facebook.com/intern/diff/D75959063/)
0 commit comments