Skip to content

Commit d6296de

Browse files
mcremon-metafacebook-github-bot
authored andcommitted
Disable mean fallback op (#18815)
Summary: POR models (and virtually anything else that I've seen) only use mean on floats. Removing the fallback by default saves 75.6kB in .text. Differential Revision: D100258757
1 parent 2c545f8 commit d6296de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backends/cadence/fusion_g3/operators/op_mean.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Tensor& mean_out(
151151
p_axis,
152152
num_axis_dims);
153153
} else {
154+
#ifdef G3_ENABLE_ALL_DTYPES
154155
ET_KERNEL_CHECK(
155156
ctx,
156157
torch::executor::check_mean_dim_args(in, dim_list, keepdim, dtype, out),
@@ -183,6 +184,10 @@ Tensor& mean_out(
183184
}
184185
});
185186
});
187+
#else
188+
ET_DCHECK_MSG(
189+
false, "mean.out: non-float dtypes require G3_ENABLE_ALL_DTYPES");
190+
#endif
186191
}
187192

188193
return out;

0 commit comments

Comments
 (0)