Skip to content

Commit e1a9f91

Browse files
authored
Add q_dq_ops targets to only build q dq ops for Windows
Differential Revision: D65393800 Pull Request resolved: #6628
1 parent e2b5bca commit e1a9f91

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

kernels/quantized/targets.bzl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ def define_common_targets():
6060
define_static_targets = True,
6161
)
6262

63+
# On Windows we can only compile these two ops currently, so adding a
64+
# separate target for this.
65+
et_operator_library(
66+
name = "q_dq_ops",
67+
ops = [
68+
"quantized_decomposed::dequantize_per_tensor.out",
69+
"quantized_decomposed::dequantize_per_tensor.Tensor_out",
70+
],
71+
)
72+
6373
for aten_mode in (True, False):
6474
aten_suffix = "_aten" if aten_mode else ""
6575

@@ -92,6 +102,25 @@ def define_common_targets():
92102
define_static_targets = True,
93103
)
94104

105+
# On Windows we can only compile these two ops currently, so adding a
106+
# separate target for this.
107+
executorch_generated_lib(
108+
name = "q_dq_ops_generated_lib" + aten_suffix,
109+
custom_ops_yaml_target = ":quantized.yaml",
110+
kernel_deps = [
111+
"//executorch/kernels/quantized/cpu:op_quantize" + aten_suffix,
112+
"//executorch/kernels/quantized/cpu:op_dequantize" + aten_suffix,
113+
],
114+
aten_mode = aten_mode,
115+
deps = [
116+
":q_dq_ops",
117+
],
118+
visibility = [
119+
"//executorch/...",
120+
"@EXECUTORCH_CLIENTS",
121+
],
122+
)
123+
95124
runtime.python_library(
96125
name = "quantized_ops_lib",
97126
srcs = ["__init__.py"],

shim/xplat/executorch/kernels/portable/op_registration_util.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_
118118
],
119119
visibility = [
120120
"//executorch/kernels/portable/test/...",
121-
"//executorch/kernels/quantized/test/...",
121+
"//executorch/kernels/quantized/...",
122122
"//executorch/kernels/optimized/test/...",
123123
"//executorch/kernels/test/...",
124124
"@EXECUTORCH_CLIENTS",

0 commit comments

Comments
 (0)