Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aten/src/ATen/native/vulkan/glsl/templates/conv2d_pw.glslt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* WEIGHT_STORAGE = TEXTURE_2D
* WEIGHT_STORAGE_LAYOUT = OC4,IC4,4ic,4oc
* BIAS_STORAGE = TEXTURE_2D
* REGISTER_FOR = $REGISTER_FOR
*/

layout(std430) buffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ conv2d_pw:
parameter_names_with_default_values:
TILE_SIZE_X: 2
TILE_SIZE_Y: 2
REGISTER_FOR:
- !!python/tuple ["conv2d_pw", ["catchall"]]
parameter_values:
- TILE_SIZE_X: 1
TILE_SIZE_Y: 1
REGISTER_FOR: null
2 changes: 1 addition & 1 deletion aten/src/ATen/native/vulkan/ops/Convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static api::ShaderInfo get_shader(
}
break;
case Conv2dPointwise:
shader = VK_KERNEL(conv2d_pw_2x2);
shader = VK_LOOKUP_KERNEL(conv2d_pw);
break;
}
return shader;
Expand Down
2 changes: 1 addition & 1 deletion tools/gen_vulkan_spv.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def generate(self, glsl_template_in, out_dir): # type: ignore[no-untyped-def]
code_template = CodeTemplate.from_file(glsl_template_in)
for template_params in self.ops_template_params[op_name]:
content = VulkanShaderGenerator.standard_header
param_vals_string = "x".join([str(i) for i in template_params.values()])
param_vals_string = "x".join([str(i) for (k, i) in template_params.items() if k != "REGISTER_FOR"])
output_file_name = op_name + "_" + param_vals_string + ".glsl"
content += code_template.substitute(template_params)
output_file = os.path.join(out_dir, output_file_name)
Expand Down