Skip to content

Commit ab60961

Browse files
committed
update usage
1 parent 1a0116c commit ab60961

File tree

8 files changed

+16
-90
lines changed

8 files changed

+16
-90
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ if(EXECUTORCH_BUILD_PYBIND)
811811

812812
if(EXECUTORCH_BUILD_COREML)
813813
list(APPEND _dep_libs coremldelegate)
814-
list(APPEND _dep_libs coreml_inmemoryfs_pybinding)
814+
list(APPEND _dep_libs executorchcoreml)
815815
endif()
816816

817817
if(EXECUTORCH_BUILD_MPS)
@@ -936,7 +936,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
936936

937937
if(EXECUTORCH_BUILD_COREML)
938938
list(APPEND _executor_runner_libs coremldelegate)
939-
list(APPEND _executor_runner_libs coreml_inmemoryfs_pybinding)
939+
list(APPEND _executor_runner_libs executorchcoreml)
940940
endif()
941941

942942
add_executable(executor_runner ${_executor_runner__srcs})

backends/apple/coreml/compiler/coreml_preprocess.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import coremltools as ct
1818
import coremltools.optimize as cto
19-
import executorchcoreml
2019

20+
from executorch.backends.apple.coreml import executorchcoreml
2121
from executorch.exir.backend.backend_details import (
2222
BackendDetails,
2323
ExportedProgram,

backends/apple/coreml/runtime/inmemoryfs/setup.py

-52
This file was deleted.

backends/apple/coreml/scripts/install_inmemoryfs.sh

-25
This file was deleted.

backends/apple/coreml/scripts/install_requirements.sh

-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ if [ $STATUS -ne 0 ]; then
6262
exit 1
6363
fi
6464

65-
sh "$COREML_DIR_PATH/scripts/install_inmemoryfs.sh"
66-
6765
echo "${green}ExecuTorch: Copying protobuf files."
6866
mkdir -p "$COREML_DIR_PATH/runtime/sdk/format/"
6967
cp -rf "$PROTOBUF_FILES_DIR_PATH" "$COREML_DIR_PATH/runtime/sdk/format/"

examples/apple/coreml/scripts/extract_coreml_models.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010

1111
from typing import List, Optional
1212

13-
import executorchcoreml
14-
13+
from executorch.backends.apple.coreml import executorchcoreml
1514
from executorch.backends.apple.coreml.compiler import CoreMLBackend
16-
1715
from executorch.exir._serialize._program import deserialize_pte_binary
18-
1916
from executorch.exir.schema import (
2017
BackendDelegate,
2118
BackendDelegateDataReference,

install_executorch.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ def handle_pybind(args, cmake_args, executorch_build_pybind):
187187
elif pybind_arg == "mps":
188188
cmake_args += " -DEXECUTORCH_BUILD_MPS=ON"
189189
else:
190-
cmake_args += f" -DEXECUTORCH_BUILD_{pybind_arg.upper()}=ON"
190+
name = f"EXECUTORCH_BUILD_{pybind_arg.upper()}"
191+
cmake_args += f" -D{name}=ON"
192+
os.environ[name] = "ON"
191193
executorch_build_pybind = "ON"
192194
return executorch_build_pybind, cmake_args
193195

setup.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,12 @@ def run(self):
680680
# add entries like `-DEXECUTORCH_BUILD_XNNPACK=ON` to the CMAKE_ARGS
681681
# environment variable.
682682

683+
if ShouldBuild.coreml():
684+
cmake_args += [
685+
"-DEXECUTORCH_BUILD_COREML=ON",
686+
]
687+
build_args += ["--target", "executorchcoreml"]
688+
683689
if ShouldBuild.llama_custom_ops():
684690
cmake_args += [
685691
"-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON", # add llama sdpa ops to pybindings.
@@ -786,12 +792,12 @@ def get_ext_modules() -> List[Extension]:
786792
]
787793
)
788794

789-
if ShouldBuild.pybindings() or ShouldBuild.coreml():
795+
if ShouldBuild.coreml():
790796
ext_modules.append(
791797
BuiltExtension(
792-
src="coreml_inmemoryfs_pybinding.*",
798+
src="executorchcoreml.*",
793799
src_dir="backends/apple/coreml",
794-
modpath="executorch.backends.apple.coreml.inmemoryfs",
800+
modpath="executorch.backends.apple.coreml.executorchcoreml",
795801
)
796802
)
797803

0 commit comments

Comments
 (0)