Skip to content

Commit e018f40

Browse files
SS-JIAfacebook-github-bot
authored andcommitted
QConv: Use buffer storage for weights
Summary: TSIA! Differential Revision: D88701731
1 parent 1fe59c8 commit e018f40

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

backends/vulkan/runtime/graph/ops/glsl/conv2d_q8_utils.glslh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ ivec4 load_weight_block(
9090
const int Kw,
9191
const int Kh,
9292
const int OC4) {
93-
#ifdef PACKED_INT8_WEIGHTS_BUFFER
93+
#ifdef WEIGHT_BUFFER
9494
const int block_x = oc4 * Kw + kx;
9595
const int block_y = ky * IC4 + ic4;
9696
return t_packed_int8_weight[block_y * (Kw * OC4) + block_x];

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ conv2d_q8ta_q8csw_q8to:
1313
combination:
1414
parameter_names: [IO_STORAGE, WEIGHT_STORAGE]
1515
combos:
16+
- parameter_values: [buffer, buffer]
1617
- parameter_values: [buffer, texture2d]
18+
- parameter_values: [texture3d, buffer]
1719
- parameter_values: [texture3d, texture2d]
1820
DTYPE:
1921
- VALUE: float

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,7 @@ ValueRef prepack_quantized_conv2d_weight(
442442

443443
std::vector<int64_t> packed_weight_sizes{output_height, output_width};
444444

445-
utils::StorageType storage_type = utils::kTexture2D;
446-
uint32_t max_extent = graph.context()->adapter_ptr()->max_texture2d_dim();
447-
if (output_width > max_extent * 4 || output_height > max_extent) {
448-
storage_type = utils::kBuffer;
449-
}
445+
utils::StorageType storage_type = utils::kBuffer;
450446

451447
ValueRef packed_weight = graph.add_tensor(
452448
packed_weight_sizes,

0 commit comments

Comments
 (0)