Skip to content

Commit ac2c959

Browse files
wl1026sunfacebook-github-bot
authored andcommitted
to make TIE quantized conv operator to fall back to hifi quantized conv op instead of cpu op for shapes not supported by the TIE kernel.
Summary: some quantized conv shape are not supported by the TIE operator, right now the tie op will fall back to CPU op. with this diff would fall back to use the operator from the hifi non-tie backend instead. Differential Revision: D74337713
1 parent bb7e50f commit ac2c959

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

backends/cadence/hifi/operators/operators.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ using ::executorch::aten::optional;
1616
using ::executorch::aten::ScalarType;
1717
using ::executorch::aten::Tensor;
1818
using ::executorch::runtime::KernelRuntimeContext;
19+
using ::executorch::aten::IntArrayRef;
1920

2021
namespace cadence {
2122
namespace impl {
@@ -67,6 +68,44 @@ void quantized_linear_per_tensor_out(
6768
__ET_UNUSED const optional<Tensor>& offset,
6869
Tensor& out);
6970

71+
void quantized_conv_out(
72+
__ET_UNUSED KernelRuntimeContext& ctx,
73+
const Tensor& input,
74+
const Tensor& weight,
75+
const Tensor& bias,
76+
IntArrayRef stride,
77+
IntArrayRef padding,
78+
IntArrayRef dilation,
79+
int64_t groups,
80+
int64_t in_zero_point,
81+
const Tensor& weight_zero_point,
82+
const Tensor& bias_scale,
83+
double output_scale,
84+
int64_t output_zero_point,
85+
__ET_UNUSED const Tensor& out_multiplier,
86+
__ET_UNUSED const Tensor& out_shift,
87+
bool channel_last,
88+
Tensor& out) ;
89+
90+
void quantized_conv_per_tensor_out(
91+
__ET_UNUSED KernelRuntimeContext& ctx,
92+
const Tensor& input,
93+
const Tensor& weight,
94+
const Tensor& bias,
95+
IntArrayRef stride,
96+
IntArrayRef padding,
97+
IntArrayRef dilation,
98+
int64_t groups,
99+
int64_t in_zero_point,
100+
int64_t weight_zero_point,
101+
double bias_scale,
102+
double output_scale,
103+
int64_t output_zero_point,
104+
__ET_UNUSED int64_t out_multiplier,
105+
__ET_UNUSED int64_t out_shift,
106+
bool channel_last,
107+
Tensor& out) ;
108+
70109
} // namespace native
71110
} // namespace HiFi
72111
} // namespace impl

0 commit comments

Comments
 (0)