executorch icon indicating copy to clipboard operation
executorch copied to clipboard

ExecuTorch: Failed to install inmemoryfs extension.

Open ITHelpDec opened this issue 11 months ago • 6 comments

Hi there,

I'm currently unable to get any further in the iOS Demo App Tutorial when running...

sh backends/apple/coreml/scripts/install_requirements.sh

...from BUILDING AND RUNNING EXECUTORCH WITH CORE ML BACKEND.


I receive the following errors...

sh backends/apple/coreml/scripts/install_requirements.sh
...
ExecuTorch: Installing inmemoryfs extension.
Processing ./backends/apple/coreml/runtime/inmemoryfs
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: executorchcoreml
  Building wheel for executorchcoreml (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [77 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'executorchcoreml' extension
      creating build
      creating build/temp.macosx-10.9-x86_64-cpython-310
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /usr/local/anaconda3/envs/executorch/include -fPIC -O2 -isystem /usr/local/anaconda3/envs/executorch/include -DVERSION_INFO=0.0.1 -I../../third-party/nlohmann_json/single_include/nlohmann -I. -I/usr/local/anaconda3/envs/executorch/lib/python3.10/site-packages/pybind11/include -I/usr/local/anaconda3/envs/executorch/include/python3.10 -c inmemory_filesystem.cpp -o build/temp.macosx-10.9-x86_64-cpython-310/inmemory_filesystem.o -fvisibility=hidden -g0 -std=c++17 -mmacosx-version-min=10.14 -mmacosx-version-min=10.15
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /usr/local/anaconda3/envs/executorch/include -fPIC -O2 -isystem /usr/local/anaconda3/envs/executorch/include -DVERSION_INFO=0.0.1 -I../../third-party/nlohmann_json/single_include/nlohmann -I. -I/usr/local/anaconda3/envs/executorch/lib/python3.10/site-packages/pybind11/include -I/usr/local/anaconda3/envs/executorch/include/python3.10 -c inmemory_filesystem_py.cpp -o build/temp.macosx-10.9-x86_64-cpython-310/inmemory_filesystem_py.o -fvisibility=hidden -g0 -std=c++17 -mmacosx-version-min=10.14 -mmacosx-version-min=10.15
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /usr/local/anaconda3/envs/executorch/include -fPIC -O2 -isystem /usr/local/anaconda3/envs/executorch/include -DVERSION_INFO=0.0.1 -I../../third-party/nlohmann_json/single_include/nlohmann -I. -I/usr/local/anaconda3/envs/executorch/lib/python3.10/site-packages/pybind11/include -I/usr/local/anaconda3/envs/executorch/include/python3.10 -c memory_buffer.cpp -o build/temp.macosx-10.9-x86_64-cpython-310/memory_buffer.o -fvisibility=hidden -g0 -std=c++17 -mmacosx-version-min=10.14 -mmacosx-version-min=10.15
      memory_buffer.cpp:44:32: error: implicit instantiation of undefined template 'std::vector<unsigned char>'
          const std::vector<uint8_t> buffer_;
                                     ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:35:50: error: implicit instantiation of undefined template 'std::vector<unsigned char>'
          explicit MallocedBuffer(std::vector<uint8_t> buffer) noexcept
                                                       ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:90:26: error: implicit instantiation of undefined template 'std::vector<unsigned char>'
          std::vector<uint8_t> buffer(region.size, 0);
                               ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:131:58: error: implicit instantiation of undefined template 'std::vector<std::shared_ptr<inmemoryfs::MemoryBuffer>>'
      std::vector<std::shared_ptr<MemoryBuffer>> MemoryBuffer::read_file_content(const std::string& file_path,
                                                               ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:137:16: error: implicit instantiation of undefined template 'std::vector<std::shared_ptr<inmemoryfs::MemoryBuffer>>'
              return {};
                     ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:140:48: error: implicit instantiation of undefined template 'std::vector<std::shared_ptr<inmemoryfs::MemoryBuffer>>'
          std::vector<std::shared_ptr<MemoryBuffer>> result;
                                                     ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:141:27: error: implicit instantiation of undefined template 'std::vector<inmemoryfs::MemoryRegion>'
          result.reserve(regions.size());
                                ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:142:30: error: implicit instantiation of undefined template 'std::vector<inmemoryfs::MemoryRegion>'
          for (const auto& region: regions) {
                                   ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:145:20: error: implicit instantiation of undefined template 'std::vector<std::shared_ptr<inmemoryfs::MemoryBuffer>>'
                  return {};
                         ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:170:26: error: implicit instantiation of undefined template 'std::vector<unsigned char>'
          std::vector<uint8_t> bytes;
                               ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      memory_buffer.cpp:176:71: error: implicit instantiation of undefined template 'std::vector<unsigned char>'
      std::shared_ptr<MemoryBuffer> MemoryBuffer::make(std::vector<uint8_t> bytes) {
                                                                            ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:259:28: note: template is declared here
      class _LIBCPP_TEMPLATE_VIS vector;
                                 ^
      11 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for executorchcoreml
  Running setup.py clean for executorchcoreml
Failed to build executorchcoreml
ERROR: Could not build wheels for executorchcoreml, which is required to install pyproject.toml-based projects
ExecuTorch: Failed to install inmemoryfs extension.

...when reaching the final inmemoryfs stage.


My environment is below.

python -m torch.utils.collect_env
Collecting environment information...
PyTorch version: 2.2.0.dev20231010
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.7.2 (x86_64)
GCC version: Could not collect
Clang version: 14.0.0 (clang-1400.0.29.202)
CMake version: version 3.26.4
Libc version: N/A

Python version: 3.10.13 (main, Sep 11 2023, 08:39:02) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-10.16-x86_64-i386-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz

Versions of relevant libraries:
[pip3] executorch==0.1.0
[pip3] numpy==1.21.3
[pip3] torch==2.2.0.dev20231010
[pip3] torchaudio==2.2.0.dev20231010
[pip3] torchsr==1.0.4
[pip3] torchvision==0.17.0.dev20231010
[conda] executorch                0.1.0                    pypi_0    pypi
[conda] numpy                     1.21.3                   pypi_0    pypi
[conda] torch                     2.2.0.dev20231010          pypi_0    pypi
[conda] torchaudio                2.2.0.dev20231010          pypi_0    pypi
[conda] torchsr                   1.0.4                    pypi_0    pypi
[conda] torchvision               0.17.0.dev20231010          pypi_0    pypi

ITHelpDec avatar Mar 05 '24 15:03 ITHelpDec

@ITHelpDec are you trying to build the main or stable branch? If main could you please pull the latest changes and try again?

cymbalrush avatar Mar 17 '24 20:03 cymbalrush

I used the branch listed in the page "SETTING UP EXECUTORCH"

git clone --branch v0.1.0 https://github.com/pytorch/executorch.git

I tried main previously, but had other errors - will try again at another point.

ITHelpDec avatar Mar 17 '24 23:03 ITHelpDec

I'm seeing exactly this error on v0.1.0-rc2. It appears to be fixed on main

kaeawc avatar Mar 25 '24 17:03 kaeawc

I'm seeing exactly this error on v0.1.0-rc2. It appears to be fixed on main

which commit you try success?

zbliujia avatar Apr 12 '24 12:04 zbliujia

Can you try with git clone --branch v0.2.0 https://github.com/pytorch/executorch.git?

mergennachin avatar May 13 '24 19:05 mergennachin

Can you try with git clone --branch v0.2.0 https://github.com/pytorch/executorch.git?

Sorry for the radio silence - I'll attempt to give this a go next time I'm on the Intel-based Mac

ITHelpDec avatar May 14 '24 08:05 ITHelpDec