Skip to content

Commit 58f5ebd

Browse files
author
ssjia
committed
Update on "[ET-VK][AOT] Enable exporting Q8 Quantized Linear + Convolution"
As title. Introduce fusion patterns to enable fusing quantized convolution and linear graph patterns into a custom op. ## Changes Introduce the concept of using custom pattern detection functions to detect graph patterns rather than solely relying on SubgraphMatcher. The issue with SubgraphMatcher is that a large number of graph patterns may need to be exported to obtain variants for different combinations of decompositions/quantization workflows. Having a custom detection function improves maintainability. Implement detection + replacement functions for quantized linear and quantized conv2d. Differential Revision: [D81323425](https://our.internmc.facebook.com/intern/diff/D81323425/) [ghstack-poisoned]
2 parents 8dc1b78 + c680357 commit 58f5ebd

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

backends/vulkan/custom_ops_lib.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ def conv2d_q8ta_q8csw(
408408

409409
# Reshape to original 4D format (OC, IC, H, W)
410410
qweights_4d = qweights_transposed.view(OC, IC, H, W)
411-
print(qweights_4d.shape)
412411

413412
# Dequantize weights
414413
weights = torch.ops.quantized_decomposed.dequantize_per_channel(
@@ -420,8 +419,6 @@ def conv2d_q8ta_q8csw(
420419
127,
421420
torch.int8,
422421
)
423-
print(weights.shape)
424-
print(x.shape)
425422

426423
# Perform convolution
427424
out = torch.nn.functional.conv2d(

backends/vulkan/test/test_vulkan_delegate.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ def quantize_and_lower_module(
104104

105105
program = export(program, sample_inputs, dynamic_shapes=dynamic_shapes)
106106

107-
print(program.graph_module.graph)
108-
# test = to_edge(
109-
# program,
110-
# compile_config=EdgeCompileConfig(_check_ir_validity=False),
111-
# )
112-
# print(program.exported_program().graph_module)
113-
# raise Exception("stop")
114-
115107
edge_program = to_edge_transform_and_lower(
116108
program,
117109
compile_config=edge_compile_config,

0 commit comments

Comments
 (0)