Skip to content

Commit

Permalink
Call the quantizer from the OSS repo (#3597)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #3597

As titled. Remove the unneeded meta-repo things as well!

Reviewed By: tarun292, dulinriley, zonglinpengmeta

Differential Revision: D57084231

fbshipit-source-id: 8d23f869080a729d5fab5026194fefe22f7e34c2
  • Loading branch information
mcremon-meta authored and facebook-github-bot committed May 16, 2024
1 parent 46ec26b commit c7104db
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
49 changes: 49 additions & 0 deletions backends/cadence/aot/quantizer/TARGETS
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")

oncall("odai_jarvis")

python_library(
name = "utils",
srcs = [
"utils.py",
],
deps = [
"//caffe2:torch",
],
)

python_library(
name = "patterns",
srcs = [
"patterns.py",
],
deps = [
":utils",
"//caffe2:torch",
],
)

python_library(
name = "quantizer",
srcs = [
"quantizer.py",
],
deps = [
":patterns",
":utils",
"//caffe2:torch",
],
)

python_library(
name = "fusion_pass",
srcs = [
"fusion_pass.py",
],
deps = [
":patterns",
":utils",
"//caffe2:torch",
"//executorch/exir:pass_base",
],
)
2 changes: 1 addition & 1 deletion backends/cadence/aot/quantizer/fusion_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def get_args_and_kwargs_matmul(
inputs_inputs: List[fx.Node],
dequants_inputs: List[fx.Node],
quant_node: fx.Node,
) -> Tuple[Tuple[Any], Dict[str, Any]]:
) -> Tuple[Tuple[Any, ...], Dict[str, Any]]:
requantize_scale = (
# pyre-ignore[58]: Unsupported operand
dequants_inputs[0].args[1]
Expand Down
1 change: 0 additions & 1 deletion backends/cadence/aot/quantizer/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ def get_anchors(self, gm, fused_partition) -> PartitionAnchors:
weights=[],
biases=[],
# Ordering: normalized_shape, weights, bias
# pyre-fixme[6]: Incompatible parameter type
others=others,
output=[(layer_norm_node,)],
)
Expand Down

0 comments on commit c7104db

Please sign in to comment.