-
Notifications
You must be signed in to change notification settings - Fork 758
Open
Labels
partner: armFor backend delegation, kernels, demo, etc. from the 3rd-party partner, ArmFor backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm
Description
Hi,
I use https://github.com/pytorch/executorch/blob/main/examples/arm/ethos_u_minimal_example.ipynb to export example model and run on FVP.
The output is 2.0(float).
But I modify the code and that it output and intput to be int8. But the output at FVP show 1(char).
I think that it is wrong. How can I fix it?
from executorch.backends.arm.ethosu import EthosUPartitioner
from executorch.exir import (
EdgeCompileConfig,
ExecutorchBackendConfig,
to_edge_transform_and_lower,
)
from executorch.extension.export_util.utils import save_pte_program
from executorch.exir.passes.quantize_io_pass import QuantizeInputs, QuantizeOutputs
# Create partitioner from compile spec
partitioner = EthosUPartitioner(compile_spec)
# Lower the exported program to the Ethos-U backend
edge_program_manager = to_edge_transform_and_lower(
quantized_exported_program,
partitioner=[partitioner],
compile_config=EdgeCompileConfig(
_check_ir_validity=False,
),
)
edge_program_manager.transform(passes=[QuantizeInputs(edge_program_manager, [0, 1]), QuantizeOutputs(edge_program_manager, [0])])
# Convert edge program to executorch
executorch_program_manager = edge_program_manager.to_executorch(
config=ExecutorchBackendConfig(extract_delegate_segments=False)
)
_ = executorch_program_manager.exported_program().graph_module.print_readable()
# Save pte file
save_pte_program(executorch_program_manager, "ethos_u_minimal_example_test_inout_int8.pte")
By the way, according to #7590
How can the embedded application access the quantisation scale & zero point finally?
Thanks,
Kris
Metadata
Metadata
Assignees
Labels
partner: armFor backend delegation, kernels, demo, etc. from the 3rd-party partner, ArmFor backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm