Skip to content

Commit 1eb924f

Browse files
Zonglin Pengzonglinpeng
authored andcommitted
Populate cadence cpu ops (#7165)
Summary: quantized ops in CPU flow are not fully migrated. Adding them all in this PR - quantized_linear_per_tensor_out Test Plan: python3 -m examples.cadence.operators.quantized_linear_op Reviewed By: hsharma35, mcremon-meta Differential Revision: D66726864 Pulled By: zonglinpeng
1 parent 37d8267 commit 1eb924f

File tree

9 files changed

+1215
-262
lines changed

9 files changed

+1215
-262
lines changed

backends/cadence/aot/functions.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,18 @@
183183
kernels:
184184
- arg_meta: null
185185
kernel_name: impl::reference::quantized_matmul_out
186+
187+
- func: cadence::quantized_linear.per_tensor_out(Tensor src, Tensor weight, Tensor bias, SymInt src_zero_point, SymInt weight_zero_point, SymInt out_multiplier, SymInt out_shift, SymInt out_zero_point, Tensor? offset, *, Tensor(a!) out) -> Tensor(a!)
188+
kernels:
189+
- arg_meta: null
190+
kernel_name: impl::reference::quantized_linear_per_tensor_out
191+
192+
- func: cadence::im2row.out(Tensor input, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, Tensor in_zero_point, bool channel_last=False, *, Tensor(a!) out) -> Tensor(a!)
193+
kernels:
194+
- arg_meta: null
195+
kernel_name: impl::reference::im2row_out
196+
197+
- func: cadence::quantized_conv.per_tensor_out(Tensor input, Tensor weight, Tensor bias, int[] stride, SymInt[] padding, int[] dilation, int groups, int input_zero_point, int weight_zero_point, float bias_scale, float out_scale, int out_zero_point, int out_multiplier, int out_shift, bool channel_last=False, *, Tensor(a!) out) -> Tensor(a!)
198+
kernels:
199+
- arg_meta: null
200+
kernel_name: impl::reference::quantized_conv_per_tensor_out

backends/cadence/reference/operators/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ set(_aten_ops__srcs
5555
"${EXECUTORCH_ROOT}/kernels/portable/cpu/op_expand_copy.cpp"
5656
"${EXECUTORCH_ROOT}/kernels/portable/cpu/op_gelu.cpp"
5757
"${EXECUTORCH_ROOT}/kernels/portable/cpu/op_empty.cpp"
58+
"${EXECUTORCH_ROOT}/kernels/portable/cpu/util/dtype_util.cpp"
5859
)
5960
add_library(aten_ops_cadence ${_aten_ops__srcs})
6061
target_link_libraries(aten_ops_cadence PUBLIC executorch)
@@ -72,12 +73,13 @@ target_include_directories(
7273
add_library(
7374
custom_ops
7475
"quantized_linear_out.cpp"
75-
"quantized_conv_out.cpp"
7676
"quantized_relu_out.cpp"
7777
"quantized_layer_norm.cpp"
7878
"quantize_per_tensor.cpp"
7979
"dequantize_per_tensor.cpp"
8080
"quantized_matmul_out.cpp"
81+
"im2row_out.cpp"
82+
"convolution_out.cpp"
8183
)
8284
target_include_directories(
8385
custom_ops PUBLIC ${ROOT_DIR}/.. ${CMAKE_BINARY_DIR}

0 commit comments

Comments
 (0)