From 1ea862e1672635a133dcdba8d0e9b450366ff37a Mon Sep 17 00:00:00 2001 From: Max Ren <40742183+mcr229@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:22:27 -0700 Subject: [PATCH] Add Dynamic Quantized Partitioner along with General Partitioner (#221) * Add Dynamic Quantized Partitioner along with General Partitioner * lint export_et --- export_et.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/export_et.py b/export_et.py index 6e7de441b..eecba7ec7 100644 --- a/export_et.py +++ b/export_et.py @@ -11,7 +11,10 @@ import torch.nn as nn from build.model import Transformer -from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner +from executorch.backends.xnnpack.partition.xnnpack_partitioner import ( + XnnpackDynamicallyQuantizedPartitioner, + XnnpackPartitioner, +) # TODO: change back to executorch.examples.portable.utils # when executorch installs correctly @@ -121,7 +124,7 @@ def export_model(model, device, output_path, args=None) -> str: # noqa: C901 dynamic_shapes=dynamic_shapes, edge_compile_config=edge_config, ) - + edge_manager = edge_manager.to_backend(XnnpackDynamicallyQuantizedPartitioner()) edge_manager = edge_manager.to_backend(XnnpackPartitioner()) export_program = edge_manager.to_executorch( ExecutorchBackendConfig(