Skip to content

Commit 15ef4bc

Browse files
mcremon-metafacebook-github-bot
authored andcommitted
Disable mean fallback op
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 36e8ed9 commit 15ef4bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

backends/cadence/fusion_g3/operators/op_mean.cpp

Lines changed: 4 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,9 @@ Tensor& mean_out(
183184
}
184185
});
185186
});
187+
#else
188+
ET_CHECK_MSG(false, "mean.out: non-float dtypes require G3_ENABLE_ALL_DTYPES");
189+
#endif
186190
}
187191

188192
return out;

0 commit comments

Comments
 (0)