Skip to content

fix quantized ic3/ic4/edsr examples #574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/xnnpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class XNNPackOptions(object):
"add": XNNPackOptions(True, True),
"add_mul": XNNPackOptions(True, True),
"dl3": XNNPackOptions(True, True),
"ic3": XNNPackOptions(True, False),
"ic4": XNNPackOptions(True, False),
"ic3": XNNPackOptions(True, True),
"ic4": XNNPackOptions(True, True),
"mv2": XNNPackOptions(True, True),
"mv3": XNNPackOptions(True, True),
"resnet18": XNNPackOptions(True, True),
"resnet50": XNNPackOptions(True, True),
"vit": XNNPackOptions(False, True),
"w2l": XNNPackOptions(False, True),
"edsr": XNNPackOptions(True, False),
"edsr": XNNPackOptions(True, True),
"mobilebert": XNNPackOptions(True, False),
}

Expand Down
5 changes: 5 additions & 0 deletions examples/xnnpack/aot_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner
from executorch.exir import EdgeCompileConfig
from torch.ao.quantization.quantizer.xnnpack_quantizer_utils import (
convert_scalars_to_attrs,
)

from ..models import MODEL_NAME_TO_MODEL
from ..models.model_factory import EagerModelFactory
Expand Down Expand Up @@ -75,6 +78,8 @@

if args.quantize:
logging.info("Quantizing Model...")
# TODO(T165162973): This pass shall eventually be folded into quantizer
model = convert_scalars_to_attrs(model)
model = quantize(model, example_inputs)

edge = export_to_edge(
Expand Down