Serialize all scalar types (#2414)
Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/2414
Adds all the [non-quantized scalar types from ATen Vulkan](https://github.com/pytorch/pytorch/blob/main/aten/src/ATen/native/vulkan/api/Types.h#L21-L26).
```
_(uint8_t, VK_FORMAT_R8G8B8A8_UINT, Byte) \
_(int8_t, VK_FORMAT_R8G8B8A8_SINT, Char) \
_(int32_t, VK_FORMAT_R32G32B32A32_SINT, Int) \
_(bool, VK_FORMAT_R8G8B8A8_SINT, Bool) \
_(unsigned short, VK_FORMAT_R16G16B16A16_SFLOAT, Half) \
_(float, VK_FORMAT_FLOAT4, Float) \
```
Tensor images and buffers will now be created according to this `dtype`.
It's up to contributors to associate their shader to one of these dtypes, e.g., in [`all_shaders.yaml`](https://github.com/pytorch/executorch/blob/main/backends/vulkan/runtime/graph/ops/glsl/all_shaders.yaml#L32-L46).
```
image_to_nchw:
...
generate_variant_forall:
DTYPE:
- VALUE: "half"
SUFFIX: "half"
- VALUE: "float"
SUFFIX: "float"
...
```
ghstack-source-id: 218582139
bypass-github-export-checks
Reviewed By: SS-JIA
Differential Revision: D54873255
fbshipit-source-id: 9430e26b45e2b7fa464740aaee445db886f0f899 J
Jorge Pineda committed
1eb9a15ddca101f39ed39f3eb1f9ba84eecd9ed8
Parent: dc7df4f
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 3/14/2024, 2:56:13 AM