From 2322c0365dee2160fc12167daa6bbac17949ba96 Mon Sep 17 00:00:00 2001 From: ssjia Date: Wed, 15 Oct 2025 09:06:52 -0700 Subject: [PATCH] [ET-VK][ez] Allow bool tensors to be lowered to ET-VK and add uint8(bool) dtype variants for several compute shaders Title says it all! Differential Revision: [D84716458](https://our.internmc.facebook.com/intern/diff/D84716458/) [ghstack-poisoned] --- backends/vulkan/runtime/graph/ops/glsl/permute_buffer.yaml | 1 + backends/vulkan/runtime/graph/ops/glsl/permute_texture.yaml | 1 + backends/vulkan/utils.py | 4 ---- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/backends/vulkan/runtime/graph/ops/glsl/permute_buffer.yaml b/backends/vulkan/runtime/graph/ops/glsl/permute_buffer.yaml index 81675ae8917..6fe5a67c286 100644 --- a/backends/vulkan/runtime/graph/ops/glsl/permute_buffer.yaml +++ b/backends/vulkan/runtime/graph/ops/glsl/permute_buffer.yaml @@ -6,5 +6,6 @@ permute_buffer: - VALUE: half - VALUE: float - VALUE: int32 + - VALUE: uint8 shader_variants: - NAME: permute_buffer diff --git a/backends/vulkan/runtime/graph/ops/glsl/permute_texture.yaml b/backends/vulkan/runtime/graph/ops/glsl/permute_texture.yaml index f68b8dcdd3d..22d1bdd7b51 100644 --- a/backends/vulkan/runtime/graph/ops/glsl/permute_texture.yaml +++ b/backends/vulkan/runtime/graph/ops/glsl/permute_texture.yaml @@ -6,5 +6,6 @@ permute_texture: - VALUE: half - VALUE: float - VALUE: int32 + - VALUE: uint8 shader_variants: - NAME: permute_texture3d diff --git a/backends/vulkan/utils.py b/backends/vulkan/utils.py index 09c57f649ae..56679d13448 100644 --- a/backends/vulkan/utils.py +++ b/backends/vulkan/utils.py @@ -693,10 +693,6 @@ def make_filtered_tensor_repset( if len(tensor_val.shape) > 4: return TensorRepSet(tensor_repset.valid_buffer_layouts, set()) - # Bool tensors are currently not supported - if tensor_val.dtype == torch.bool: - return NO_STORAGE - return TensorRepSet(tensor_repset.valid_buffer_layouts, valid_texture_layouts)