Skip to content

Commit

Permalink
Add Dynamic Quantized Partitioner along with General Partitioner (#221)
Browse files Browse the repository at this point in the history
* Add Dynamic Quantized Partitioner along with General Partitioner

* lint export_et
  • Loading branch information
mcr229 authored and malfet committed Jul 17, 2024
1 parent 4274f1a commit 1ea862e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions export_et.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 1ea862e

Please sign in to comment.