Skip to content

Commit da7c873

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
Back out "delete .int overload" (#432)
Summary: Pull Request resolved: #432 Broke some assistant tests so there must be more really old models floating around Reviewed By: cccclai Differential Revision: D49506946 fbshipit-source-id: 73714c081c810934ff04012cd4ed55ff87979470
1 parent a237895 commit da7c873

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

examples/selective_build/test_selective_build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ test_buck2_select_ops_in_list() {
3232
${PYTHON_EXECUTABLE} -m examples.export.export_example --model_name="add_mul"
3333

3434
echo "Running selective build test"
35-
# set max_kernel_num=16: 13 primops, add, mul
35+
# set max_kernel_num=17: 14 primops, add, mul
3636
$BUCK run //examples/selective_build:selective_build_test \
37-
--config=executorch.max_kernel_num=16 \
37+
--config=executorch.max_kernel_num=17 \
3838
--config=executorch.select_ops=list -- --model_path=./add_mul.pte
3939

4040
echo "Removing add_mul.pte"
@@ -80,12 +80,12 @@ test_cmake_select_ops_in_list() {
8080
echo "Exporting MobilenetV2"
8181
${PYTHON_EXECUTABLE} -m examples.export.export_example --model_name="mv2"
8282

83-
# set MAX_KERNEL_NUM=16: 13 primops, add, mul
83+
# set MAX_KERNEL_NUM=17: 14 primops, add, mul
8484
(rm -rf cmake-out \
8585
&& mkdir cmake-out \
8686
&& cd cmake-out \
8787
&& retry cmake -DBUCK2="$BUCK" \
88-
-DMAX_KERNEL_NUM=16 \
88+
-DMAX_KERNEL_NUM=17 \
8989
-DBUILD_SELECTIVE_BUILD_TEST=ON \
9090
-DCMAKE_BUILD_TYPE=Release \
9191
-DSELECT_OPS_LIST="aten::convolution.out,\

kernels/prim_ops/register_prim_ops.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@ static Kernel prim_ops[] = {
210210
BOOLEAN_ET_PRIM_OP(<=, stack, context);
211211
}),
212212

213+
// executorch_prim::floordiv.int(int, int) -> int
214+
Kernel(
215+
"executorch_prim::floordiv.int",
216+
[](RuntimeContext& context, EValue** stack) {
217+
(void)context;
218+
EValue& a = *stack[0];
219+
EValue& b = *stack[1];
220+
EValue& out = *stack[2];
221+
out = EValue(a.toInt() / b.toInt());
222+
}),
223+
213224
// executorch_prim::et_copy_index.tensor(tensor, tensor) -> tensor
214225
Kernel("executorch_prim::et_copy_index.tensor", &et_copy_index),
215226

0 commit comments

Comments
 (0)