Skip to content

Commit e152fc0

Browse files
committed
[ET-VK] Tuning conv2d dw op batching size for improved performance.
This diff makes changes make stride equals dilation the default mode for conv2d dw output op. Adds a different source file to handle stride not equal dilation case. Differential Revision: [D68026015](https://our.internmc.facebook.com/intern/diff/D68026015/) ghstack-source-id: 260923510 Pull Request resolved: #7597
1 parent cde0a98 commit e152fc0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

backends/vulkan/runtime/graph/ops/glsl/conv2d_dw_output_tile.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ conv2d_dw_output_tile:
1010
NDIM: 3
1111
DTYPE: float
1212
TILE_SIZE: 3
13-
BATCH_SIZE_X: 4
13+
BATCH_SIZE_X: 8
1414
BATCH_SIZE_Y: 2
1515
generate_variant_forall:
1616
DTYPE:
@@ -22,6 +22,10 @@ conv2d_dw_output_tile:
2222
OPERATOR: clamp(X, A, B)
2323
- NAME: conv2d_dw_output_tile_5x5
2424
TILE_SIZE: 5
25+
BATCH_SIZE_X: 4
26+
BATCH_SIZE_Y: 2
2527
- NAME: conv2d_dw_output_tile_5x5_clamp
2628
OPERATOR: clamp(X, A, B)
2729
TILE_SIZE: 5
30+
BATCH_SIZE_X: 4
31+
BATCH_SIZE_Y: 2

backends/vulkan/runtime/graph/ops/impl/Convolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ Conv2dMethod get_conv2d_method(
293293
utils::uvec2 get_conv2d_dw_dispatch_divisor(
294294
const std::vector<int64_t>& weight_sizes) {
295295
if (weight_sizes.at(2) == 3 && weight_sizes.at(3) == 3) {
296-
return {4u, 2u};
296+
return {8u, 2u};
297297
}
298298
if (weight_sizes.at(2) == 5 && weight_sizes.at(3) == 5) {
299299
return {4u, 2u};

0 commit comments

Comments
 (0)