From 4c495ac02338c773121d00019bb21e066675c58d Mon Sep 17 00:00:00 2001 From: lucylq Date: Thu, 29 May 2025 09:21:22 -0700 Subject: [PATCH] Dtype selective build: disable when not in xplat and add fail msg Pull Request resolved: https://github.com/pytorch/executorch/pull/11090 ^ ghstack-source-id: 286945010 @exported-using-ghexport Differential Revision: [D75256223](https://our.internmc.facebook.com/intern/diff/D75256223/) --- examples/selective_build/targets.bzl | 4 ++-- shim_et/xplat/executorch/codegen/codegen.bzl | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/selective_build/targets.bzl b/examples/selective_build/targets.bzl index 685cf5068e4..4525b8f730f 100644 --- a/examples/selective_build/targets.bzl +++ b/examples/selective_build/targets.bzl @@ -65,7 +65,7 @@ def define_common_targets(): deps = [ ":select_ops_in_dict", ], - dtype_selective_build = True, + dtype_selective_build = is_xplat(), visibility = ["//executorch/..."], ) @@ -78,7 +78,7 @@ def define_common_targets(): deps = [ ":select_ops_in_dict", ], - dtype_selective_build = True, + dtype_selective_build = is_xplat(), visibility = ["//executorch/..."], ) diff --git a/shim_et/xplat/executorch/codegen/codegen.bzl b/shim_et/xplat/executorch/codegen/codegen.bzl index def820fd6b6..88eef69da59 100644 --- a/shim_et/xplat/executorch/codegen/codegen.bzl +++ b/shim_et/xplat/executorch/codegen/codegen.bzl @@ -644,8 +644,7 @@ def executorch_generated_lib( if dtype_selective_build: if not expose_operator_symbols and not is_xplat(): - # TODO(T225169282): make this a fail once internal cases move to xplat. - warning(""" + fail(""" Dtype selective build with expose_operator_symbols=False works only in xplat - there are undefined symbols otherwise. Please try to use xplat, or talk to the executorch team. Setting expose_operator_symbols=True is not recommended as the