Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/apple/mps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ target_include_directories(
list(TRANSFORM _mps_executor_runner__srcs PREPEND "${EXECUTORCH_ROOT}/")
add_executable(mps_executor_runner ${_mps_executor_runner__srcs})

if (CMAKE_BUILD_TYPE MATCHES "Debug")
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(FLATCC_LIB flatcc_d)
else()
set(FLATCC_LIB flatcc)
Expand Down
17 changes: 6 additions & 11 deletions examples/apple/mps/scripts/mps_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,20 @@

# Example script for exporting simple models to flatbuffer

import copy
import argparse
import copy
import logging

import torch._export as export
from executorch import exir
from executorch.backends.apple.mps.mps_preprocess import MPSBackend
from executorch.backends.apple.mps.partition.mps_partitioner import MPSPartitioner
from executorch.exir import EdgeCompileConfig

from executorch.exir import (
EdgeCompileConfig,
EdgeProgramManager,
)
from executorch.sdk import generate_etrecord
from executorch.exir import EdgeCompileConfig, EdgeProgramManager
from executorch.exir.backend.backend_api import to_backend
from executorch.exir.backend.backend_details import CompileSpec
from executorch.exir.capture._config import ExecutorchBackendConfig
from executorch.sdk import BundledProgram
from executorch.sdk import BundledProgram, generate_etrecord
from executorch.sdk.bundled_program.config import MethodTestCase, MethodTestSuite
from executorch.sdk.bundled_program.serialize import (
serialize_from_bundled_program_to_flatbuffer,
Expand Down Expand Up @@ -154,8 +149,8 @@
program_buffer = executorch_program.buffer

if args.generate_etrecord:
etrecord_path = "etrecord.bin"
logging.info("generating etrecord.bin")
generate_etrecord(etrecord_path, edge_program_manager_copy, executorch_program)
etrecord_path = "etrecord.bin"
logging.info("generating etrecord.bin")
generate_etrecord(etrecord_path, edge_program_manager_copy, executorch_program)

save_pte_program(program_buffer, model_name)
4 changes: 0 additions & 4 deletions examples/models/llama2/export_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@

# Example script for exporting Llama2 to flatbuffer

import argparse
import json
import logging
import os
import shlex

import torch

Expand Down
8 changes: 2 additions & 6 deletions examples/models/llama2/llama_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,20 @@

import unittest

import torch

from executorch.extension.pybindings import aten_lib

from .export_llama import build_model


class LlamaTest(unittest.TestCase):
def test_quantized_llama(self):
output_path = build_model(
_ = build_model(
modelname="model",
extra_opts="--fairseq2 -Q",
par_local_output=True,
resource_pkg_name=__name__,
)

def test_half_llama(self):
output_path = build_model(
_ = build_model(
modelname="model",
extra_opts="--fairseq2 -H",
par_local_output=True,
Expand Down