Skip to content

Commit

Permalink
smoke test use xnnpack
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklandsign committed Jul 25, 2024
1 parent 3c321e3 commit c569f54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/packaging/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import tempfile
from typing import Tuple

from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner
from executorch.exir import to_edge
from torch.export import export

Expand Down Expand Up @@ -60,8 +61,10 @@ def export_linear_model() -> bytes:
exported_program = export(LinearModel(), example_inputs)
print("Lowering to edge...")
edge_program = to_edge(exported_program)
print("Lowering to XNNPACK...")
edge_delegated = edge.to_backend(XnnpackPartitioner())
print("Creating ExecuTorch program...")
et_program = edge_program.to_executorch()
et_program = edge_delegated.to_executorch()

return et_program.buffer

Expand Down

0 comments on commit c569f54

Please sign in to comment.