-
Notifications
You must be signed in to change notification settings - Fork 871
Arm backend: Add experimental support for new TOSAQuantizer #18100
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
base: main
Are you sure you want to change the base?
Changes from all commits
1abaaae
5431876
f3d752e
5c02aa7
fbabbf8
885a81b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,17 +11,34 @@ | |
| """ | ||
|
|
||
| from .quantization_config import QuantizationConfig # noqa # usort: skip | ||
| from .arm_quantizer import ( # noqa | ||
| EthosUQuantizer, | ||
| get_symmetric_a16w8_quantization_config, | ||
| get_symmetric_quantization_config, | ||
| TOSAQuantizer, | ||
| VgfQuantizer, | ||
| ) | ||
|
|
||
| # Used in tests | ||
| from .arm_quantizer_utils import is_annotated # noqa | ||
|
|
||
| # Lazily import heavy quantizer classes to avoid circular imports with | ||
| # Cortex-M quantization configs. | ||
| _LAZY_EXPORTS = { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _LAZY_IMPORTS?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a workaround since the import situation is a bit messy with imports across the cortex-m and arm backend. The idea is to clean this up when things have stabilized, I didn't want to move things in this commit to make the diff cleaner, I hope this is OK. |
||
| "EthosUQuantizer": "executorch.backends.arm.quantizer.arm_quantizer", | ||
| "get_symmetric_a16w8_quantization_config": "executorch.backends.arm.quantizer.arm_quantizer", | ||
| "get_symmetric_quantization_config": "executorch.backends.arm.quantizer.arm_quantizer", | ||
| "TOSAQuantizer": "executorch.backends.arm.quantizer.arm_quantizer", | ||
| "VgfQuantizer": "executorch.backends.arm.quantizer.arm_quantizer", | ||
| } | ||
|
|
||
|
|
||
| def __getattr__(name: str): | ||
| if name not in _LAZY_EXPORTS: | ||
| raise AttributeError(f"module {__name__!r} has no attribute {name!r}") | ||
| import importlib | ||
|
|
||
| module = importlib.import_module(_LAZY_EXPORTS[name]) | ||
| return getattr(module, name) | ||
|
|
||
|
|
||
| def __dir__(): | ||
| return sorted(list(globals().keys()) + list(_LAZY_EXPORTS.keys())) | ||
|
|
||
|
|
||
| # Load quantized ops library. | ||
| try: | ||
| import executorch.extension.pybindings.portable_lib | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.