Skip to content

Commit 60b5afc

Browse files
committed
Not seeing any benefit to using DTYPE selection in add_mul model
1 parent 5cf5e8a commit 60b5afc

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

examples/selective_build/test_selective_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ aten,aten::clone.out" \
138138
rm "./mv2.pte"
139139
}
140140

141-
test_cmake_select_ops_add_in_yaml() {
141+
test_cmake_select_ops_add_in_list() {
142142
echo "Exporting add_mul"
143143
${PYTHON_EXECUTABLE} -m examples.portable.scripts.export --model_name="add_mul"
144144
local example_dir=examples/selective_build

kernels/portable/cpu/selective_build.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,22 @@ inline constexpr bool should_include_kernel_dtype(
2121
executorch::aten::ScalarType scalar_type
2222
) {
2323
return ((executorch::aten::string_view(operator_name).compare("add.out") == 0)
24-
&& (true))
25-
|| ((executorch::aten::string_view(operator_name).compare("mm.out") == 0)
26-
&& (true));
24+
&& (scalar_type == executorch::aten::ScalarType::Float || scalar_type == executorch::aten::ScalarType::Int))
25+
|| ((executorch::aten::string_view(operator_name).compare("mul.out") == 0)
26+
&& (scalar_type == executorch::aten::ScalarType::Float));
27+
// || ((executorch::aten::string_view(operator_name).compare("sub.out") == 0)
28+
// && (true));
2729
}
30+
31+
//inline constexpr bool should_include_kernel_dtype(
32+
// const char *operator_name,
33+
// executorch::aten::ScalarType scalar_type
34+
//) {
35+
// return ((executorch::aten::string_view(operator_name).compare("add.out") == 0)
36+
// && (true))
37+
// || ((executorch::aten::string_view(operator_name).compare("mm.out") == 0)
38+
// && (true));
39+
//}
2840
/*
2941
inline constexpr bool should_include_kernel_dtype(
3042
const char* ,//operator_name,

0 commit comments

Comments
 (0)