Skip to content

Commit

Permalink
Call the quantizer from the OSS repo
Browse files Browse the repository at this point in the history
Summary: As titled. Remove the unneeded meta-repo things as well!

Differential Revision: D57084231
  • Loading branch information
mcremon-meta authored and facebook-github-bot committed May 14, 2024
1 parent c69861d commit 1de5317
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 1de5317

Please sign in to comment.