Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Support on Apple M1 machine #60

Description

@lmlaaron

I am trying to install moolib on apple M1 machine because I want to use it to launch training on the laptop for educational purposes. I am able to install a CPU version of pytorch on Apple M1 and the pytorch works. However, when trying to build moolib (without CPU by using USE_CUDA=0) I have encountered the following errors:

# pip install .
Processing /moolib
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: torch>=1.6.0 in /root/miniconda3/envs/py38/lib/python3.8/site-packages (from moolib==0.2.0) (1.13.1)
Requirement already satisfied: typing-extensions in /root/miniconda3/envs/py38/lib/python3.8/site-packages (from torch>=1.6.0->moolib==0.2.0) (4.4.0)
Building wheels for collected packages: moolib
  Building wheel for moolib (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for moolib (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [73 lines of output]
      running bdist_wheel
      running build
      running build_py
      running build_ext
      CMake Warning at /root/miniconda3/envs/py38/lib/python3.8/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:22 (message):
        static library kineto_LIBRARY-NOTFOUND not found.
      Call Stack (most recent call first):
        /root/miniconda3/envs/py38/lib/python3.8/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:127 (append_torchlib_if_found)
        CMakeLists.txt:17 (find_package)
      
      
      -- PyTorch compilation flags: -D_GLIBCXX_USE_CXX11_ABI=0
      -- PyTorch include dirs: /root/miniconda3/envs/py38/lib/python3.8/site-packages/torch/include;/root/miniconda3/envs/py38/lib/python3.8/site-packages/torch/include/torch/csrc/api/include
      -- Module support is disabled.
      -- Version: 8.0.1
      -- Build type: RelWithDebInfo
      -- CXX_STANDARD: 17
      -- Required features: cxx_variadic_templates
      -- pybind11 v2.9.0 dev1
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /moolib/build/temp.linux-aarch64-cpython-38
      Consolidate compiler generated dependencies of target fmt
      [  6%] Building CXX object CMakeFiles/tensor.dir/src/tensor.cc.o
      [ 25%] Built target fmt
      [ 31%] Linking CXX static library libtensor.a
      [ 31%] Built target tensor
      [ 37%] Building CXX object CMakeFiles/moorpc.dir/src/rpc.cc.o
      [ 50%] Building CXX object CMakeFiles/moorpc.dir/src/async.cc.o
      [ 50%] Building CXX object CMakeFiles/moorpc.dir/src/transports/socket.cc.o
      [ 56%] Building CXX object CMakeFiles/moorpc.dir/src/transports/ipc.cc.o
      [ 62%] Building CXX object CMakeFiles/moorpc.dir/src/memory/memfd.cc.o
      In file included from /moolib/src/memory/allocator.h:10,
                       from /moolib/src/rpc.h:12,
                       from /moolib/src/rpc.cc:8:
      /moolib/src/synchronization.h:19:10: fatal error: x86intrin.h: No such file or directory
         19 | #include <x86intrin.h>
            |          ^~~~~~~~~~~~~
      In file included from /moolib/src/memory/allocator.h:10,
                       from /moolib/src/rpc.h:12,
                       from /moolib/src/transports/socket.h:10,
                       from /moolib/src/transports/socket.cc:8:
      /moolib/src/synchronization.h:19:10: fatal error: x86intrin.h: No such file or directory
         19 | #include <x86intrin.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      compilation terminated.
      In file included from /moolib/src/memory/allocator.h:10,
                       from /moolib/src/rpc.h:12,
                       from /moolib/src/transports/ipc.h:10,
                       from /moolib/src/transports/ipc.cc:8:
      /moolib/src/synchronization.h:19:10: fatal error: x86intrin.h: No such file or directory
         19 | #include <x86intrin.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      gmake[2]: *** [CMakeFiles/moorpc.dir/build.make:104: CMakeFiles/moorpc.dir/src/transports/socket.cc.o] Error 1
      gmake[2]: *** Waiting for unfinished jobs....
      gmake[2]: *** [CMakeFiles/moorpc.dir/build.make:76: CMakeFiles/moorpc.dir/src/rpc.cc.o] Error 1
      gmake[2]: *** [CMakeFiles/moorpc.dir/build.make:118: CMakeFiles/moorpc.dir/src/transports/ipc.cc.o] Error 1
      In file included from /moolib/src/async.cc:9:
      /moolib/src/synchronization.h:19:10: fatal error: x86intrin.h: No such file or directory
         19 | #include <x86intrin.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      gmake[2]: *** [CMakeFiles/moorpc.dir/build.make:90: CMakeFiles/moorpc.dir/src/async.cc.o] Error 1
      In file included from /moolib/src/memory/memfd.cc:3:
      /moolib/src/synchronization.h:19:10: fatal error: x86intrin.h: No such file or directory
         19 | #include <x86intrin.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      gmake[2]: *** [CMakeFiles/moorpc.dir/build.make:132: CMakeFiles/moorpc.dir/src/memory/memfd.cc.o] Error 1
      gmake[1]: *** [CMakeFiles/Makefile2:149: CMakeFiles/moorpc.dir/all] Error 2
      gmake: *** [Makefile:91: all] Error 2
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for moolib
Failed to build moolib
ERROR: Could not build wheels for moolib, which is required to install pyproject.toml-based projects

It seems it depends on some x86intrin.h which may not appear in aarch64 architecture. Is there a plan for supporting aarch64 or Apple M chips in the future?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions