-
Notifications
You must be signed in to change notification settings - Fork 872
Description
Can not run the command "python3 -m examples.apple.mps.scripts.mps_example --model_name="mv3" for "exporting and bundling the MobileNet v3 model." in ExecuTorch iOS Demo App tutorial.
Env: MacOS termial
I have installed all the additional dependencies as per the previous steps, but I'm getting an error at this stage. Is there something I might have missed?
error:
**(executorch) qiuyicheng@qiuyc-MacBook-Pro executorch % python3 -m examples.apple.mps.scripts.mps_example --model_name="mv3"
Traceback (most recent call last):
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2100, in _run_ninja_build
subprocess.run(
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/qiuyicheng/QIU/Code/pytorch/executorch/examples/apple/mps/scripts/mps_example.py", line 15, in
from executorch.backends.apple.mps.mps_preprocess import MPSBackend
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/executorch/backends/apple/mps/mps_preprocess.py", line 10, in
from executorch.backends.apple.mps.utils.graph_bindings import graph_bindings
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/executorch/backends/apple/mps/utils/graph_bindings.py", line 37, in
graph_bindings = torch.utils.cpp_extension.load(
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1308, in load
return _jit_compile(
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1710, in _jit_compile
_write_ninja_file_and_build_library(
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1823, in _write_ninja_file_and_build_library
_run_ninja_build(
File "/Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2116, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'MPSGraphBindings': [1/2] c++ -MMD -MF MPSGraphInterface.o.d -DTORCH_EXTENSION_NAME=MPSGraphBindings -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -I/Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps -isystem /Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/include -isystem /Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/include/TH -isystem /Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/include/THC -isystem /Users/qiuyicheng/miniconda3/envs/executorch/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++17 -c /Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps/utils/MPSGraphInterface.mm -o MPSGraphInterface.o
FAILED: MPSGraphInterface.o
c++ -MMD -MF MPSGraphInterface.o.d -DTORCH_EXTENSION_NAME=MPSGraphBindings -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -I/Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps -isystem /Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/include -isystem /Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/include/TH -isystem /Users/qiuyicheng/miniconda3/envs/executorch/lib/python3.10/site-packages/torch/include/THC -isystem /Users/qiuyicheng/miniconda3/envs/executorch/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++17 -c /Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps/utils/MPSGraphInterface.mm -o MPSGraphInterface.o
/Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps/utils/MPSGraphInterface.mm:118:3: error: unknown type name 'MPSGraphExecutableSerializationDescriptor'; did you mean 'MPSGraphExecutableExecutionDescriptor'?
MPSGraphExecutableSerializationDescriptor *serializationDescriptor = [MPSGraphExecutableSerializationDescriptor new];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MPSGraphExecutableExecutionDescriptor
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h:33:12: note: 'MPSGraphExecutableExecutionDescriptor' declared here
@interface MPSGraphExecutableExecutionDescriptor : NSObject
^
/Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps/utils/MPSGraphInterface.mm:118:73: error: use of undeclared identifier 'MPSGraphExecutableSerializationDescriptor'
MPSGraphExecutableSerializationDescriptor *serializationDescriptor = [MPSGraphExecutableSerializationDescriptor new];
^
/Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps/utils/MPSGraphInterface.mm:119:27: error: property 'deploymentPlatform' not found on object of type 'MPSGraphExecutableExecutionDescriptor '
serializationDescriptor.deploymentPlatform = MPSGraphDeploymentPlatformMacOS;
^
/Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps/utils/MPSGraphInterface.mm:119:48: error: use of undeclared identifier 'MPSGraphDeploymentPlatformMacOS'
serializationDescriptor.deploymentPlatform = MPSGraphDeploymentPlatformMacOS;
^
/Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps/utils/MPSGraphInterface.mm:120:27: error: property 'minimumDeploymentTarget' not found on object of type 'MPSGraphExecutableExecutionDescriptor '
serializationDescriptor.minimumDeploymentTarget = @"14.0.0";
^
/Users/qiuyicheng/QIU/Code/pytorch/executorch/backends/apple/mps/utils/MPSGraphInterface.mm:121:9: warning: instance method '-serializeToMPSGraphPackageAtURL:descriptor:' not found (return type defaults to 'id') [-Wobjc-method-access]
[exec serializeToMPSGraphPackageAtURL:bundleURL descriptor:serializationDescriptor];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h:80:12: note: receiver is instance of class declared here
@interface MPSGraphExecutable : NSObject
^
1 warning and 5 errors generated.
ninja: build stopped: subcommand failed.