Skip to content

Commit f910fda

Browse files
ivayloenfacebook-github-bot
authored andcommitted
Resolve host vs target num kernels issue for product et builds
Summary: Applying the max kernel num setting through a config/mode results in both host and target builds to limit number of kernels. This can result in a case where the host tooling is building with all ops/kernels but has the setting applied causing crashes on load. Host doen't (usually) have such memory limitation as target so adding select to disable the application of max kernel num when applying a host toolchain. Differential Revision: D82579896
1 parent ed482bd commit f910fda

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runtime/kernel/targets.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_opt
33
def _operator_registry_preprocessor_flags():
44
max_kernel_num = native.read_config("executorch", "max_kernel_num", None)
55
if max_kernel_num != None:
6-
return ["-DMAX_KERNEL_NUM=" + max_kernel_num]
6+
return select({
7+
"DEFAULT": ["-DMAX_KERNEL_NUM=" + max_kernel_num],
8+
"ovr_config//build_mode/constraints:arvr_is_host_platform": []
9+
})
710
elif not runtime.is_oss:
811
return select({
912
"DEFAULT": [],

0 commit comments

Comments
 (0)