Skip to content

Dtype selective build: fail if not xplat, if portable/optimized not in kernel_deps #10990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions shim_et/xplat/executorch/codegen/codegen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,21 @@ def executorch_generated_lib(
if not aten_mode and not functions_yaml_target and not custom_ops_yaml_target:
fail("At least one of functions_yaml_target, custom_ops_yaml_target needs to be provided")

if dtype_selective_build:
if (not "//executorch/kernels/portable:operators" in kernel_deps) and (not "//executorch/kernels/optimized:optimized_operators" in kernel_deps):
fail("""
!!WARNING!! Dtype selective build is available for the portable and optimized kernel libraries.
If you are using those, please add them to `kernel_deps` in `executorch_generated_lib`:
//executorch/kernels/portable:operators
//executorch/kernels/optimized:optimized_operators
This will tell the build system to rebuild portable/optimized with the dtype selective build header.
For examples, see: //executorch/examples/selective_build/targets.bzl
Currently, kernel_deps contains {}.

If you have a custom kernel library, please remove `dtype_selective_build=True`
and use regular selective build.
""".format(kernel_deps))

aten_suffix = "_aten" if aten_mode else ""

# merge functions.yaml with fallback yaml
Expand Down
Loading