Skip to content

Commit

Permalink
Add q_dq_ops targets to only build q dq ops for Windows
Browse files Browse the repository at this point in the history
Differential Revision: D65393800

Pull Request resolved: pytorch#6628
  • Loading branch information
tarun292 authored Nov 4, 2024
1 parent e2b5bca commit e1a9f91
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions kernels/quantized/targets.bzl
Original file line number Diff line number Diff line change
@@ -60,6 +60,16 @@ def define_common_targets():
define_static_targets = True,
)

# On Windows we can only compile these two ops currently, so adding a
# separate target for this.
et_operator_library(
name = "q_dq_ops",
ops = [
"quantized_decomposed::dequantize_per_tensor.out",
"quantized_decomposed::dequantize_per_tensor.Tensor_out",
],
)

for aten_mode in (True, False):
aten_suffix = "_aten" if aten_mode else ""

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

# On Windows we can only compile these two ops currently, so adding a
# separate target for this.
executorch_generated_lib(
name = "q_dq_ops_generated_lib" + aten_suffix,
custom_ops_yaml_target = ":quantized.yaml",
kernel_deps = [
"//executorch/kernels/quantized/cpu:op_quantize" + aten_suffix,
"//executorch/kernels/quantized/cpu:op_dequantize" + aten_suffix,
],
aten_mode = aten_mode,
deps = [
":q_dq_ops",
],
visibility = [
"//executorch/...",
"@EXECUTORCH_CLIENTS",
],
)

runtime.python_library(
name = "quantized_ops_lib",
srcs = ["__init__.py"],
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_
],
visibility = [
"//executorch/kernels/portable/test/...",
"//executorch/kernels/quantized/test/...",
"//executorch/kernels/quantized/...",
"//executorch/kernels/optimized/test/...",
"//executorch/kernels/test/...",
"@EXECUTORCH_CLIENTS",

0 comments on commit e1a9f91

Please sign in to comment.