Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will there be a M1 Mac support? #2097

Closed
JamesQFreeman opened this issue Dec 15, 2020 · 7 comments
Closed

Will there be a M1 Mac support? #2097

JamesQFreeman opened this issue Dec 15, 2020 · 7 comments
Labels
feature request Suggest an idea on this project

Comments

@JamesQFreeman
Copy link

No description provided.

@JamesQFreeman JamesQFreeman added the feature request Suggest an idea on this project label Dec 15, 2020
@k-ye
Copy link
Member

k-ye commented Dec 15, 2020

Thanks. Currently there are two problems regarding M1: 1) we don't have a M1 build bot , and 2) numpy is not working on M1 yet. Sorry about that!

@wyq977
Copy link

wyq977 commented Mar 28, 2021

I have recently tested on a m1 mac mini with miniforge installed and the installing taichi doesnt seems to works straight-forward like i expected

conda 4.9.2
Python 3.8.8

tested on a newly created env: onda create -n taichipip python=3.8

Log
$ python3 -m pip install taichi
ERROR: Could not find a version that satisfies the requirement taichi
ERROR: No matching distribution found for taichi
^CTraceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/__main__.py", line 24, in <module>
    sys.exit(_main())
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 73, in main
    return command.main(cmd_args)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 111, in main
    return self._main(args)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 226, in _main
    self.handle_pip_version_check(options)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 151, in handle_pip_version_check
    pip_self_version_check(session, options)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py", line 160, in pip_self_version_check
    best_candidate = finder.find_best_candidate("pip").best_candidate
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 872, in find_best_candidate
    candidates = self.find_all_candidates(project_name)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 815, in find_all_candidates
    package_links = self.process_project_url(
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 786, in process_project_url
    package_links = self.evaluate_links(
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 768, in evaluate_links
    candidate = self.get_install_candidate(link_evaluator, link)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 749, in get_install_candidate
    is_candidate, result = link_evaluator.evaluate_link(link)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 225, in evaluate_link
    supports_python = _check_link_requires_python(
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 74, in _check_link_requires_python
    is_compatible = check_requires_python(
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_internal/utils/packaging.py", line 37, in check_requires_python
    requires_python_specifier = specifiers.SpecifierSet(requires_python)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_vendor/packaging/specifiers.py", line 671, in __init__
    split_specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
  File "/opt/homebrew/Caskroom/miniforge/base/envs/taichipip/lib/python3.8/site-packages/pip/_vendor/packaging/specifiers.py", line 671, in <listcomp>
    split_specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]

Update

As I just checked on PyPi, it doesnt have a whl build distribution for apple silicon as of right now, just like numpy. Possibly due to lack of support in CI services available for apple silicon tho.

Thanks. Currently there are two problems regarding M1: 1) we don't have a M1 build bot , and 2) numpy is not working on M1 yet. Sorry about that!

Regarding numpy, although it does not have a wheel on PyPi but python3 -m pip install numpy was able to run nicely despite building locally is needed. conda also offers a new platform osx-arm64

$ python3 -m pip install numpy
Collecting numpy
  Downloading numpy-1.20.2.zip (7.8 MB)
     |████████████████████████████████| 7.8 MB 5.1 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517) ... done
  Created wheel for numpy: filename=numpy-1.20.2-cp38-cp38-macosx_11_0_arm64.whl size=5354637 sha256=760d63bdf0512ad92bf84e2650880014edf5428c80723689c88fb736652b8f4d
  Stored in directory: /Users/wyq977/Library/Caches/pip/wheels/e6/85/96/b353a55f333c41eb906284e4b5ff81fe65a5512edee8270e8c
Successfully built numpy
Installing collected packages: numpy
Successfully installed numpy-1.20.2

@yuanming-hu
Copy link
Member

Thanks for reporting - we are setting up an Apple M1 build bot soon, but before that you can build from scratch: https://taichi.readthedocs.io/en/latest/dev_install.html#developer-installation

@wyq977
Copy link

wyq977 commented Mar 29, 2021

Hi, thx for the prompt reply.

I read the dev installing guide and I assume that one needs to build LLVM from source

# If you are building on Apple M1, use -DLLVM_TARGETS_TO_BUILD="AArch64"

Just a question out of curisoity, r u guys hosting a CI pipeline or using services like travis or github ci because I see plenty decide to look for ci provider after travis changed pricing

Suppress warning

I also experienced with the warning as described in #2113: 'vortex' is not a recognized processor for this target (ignoring processor)

Here they edit the llvm-targets to suppress it, hopes it helps regarding how to suppress this warnning. I think its just a issue with official LLVM not recofnizing vortex as a valid CPU name.

To build a native GHC, I had to update config.subs under libraries/{ghc-bignum,base,unix}. I've also edited llvm-targets to suppress "'vortex' is not a recognized processor for this target (ignoring processor)" warning (it seems that Apple's LLVM recognizes 'vortex' as a CPU name, but the official LLVM doesn't).

I am not experience with this so afraid I can not help much regarding this :(

@wyq977
Copy link

wyq977 commented Mar 29, 2021

Checked out llvm today. Found out that they make quite a few adjustment to add arm macos or m1/a12/apple silicon(name handling is a bit confusing...)

Like in llvm/include/llvm/ADT/Triple.h

isAArch64

Also in MachO.cpp

getARM64SubType

I thought of just changing a few lines in Triple.h to suppress change but it looks like changes are quite scatter around in lots of commits... But mostly are just in llvm/include/llvm/ADT/Triple.h and lib/ExecutionEngine/JITLink/MachO.cpp, llvm/BinaryFormat/MachO.h later

link: arm64e https://reviews.llvm.org/D87095

@xchern
Copy link

xchern commented May 27, 2021

I have succeed with miniforge (https://github.com/conda-forge/miniforge), it packs a numpy build for m1.

And this is my built binary wheel for taichi (https://github.com/xchern/taichi/releases/tag/v0.7.20-apple-silicon-alpha).

@k-ye
Copy link
Member

k-ye commented Nov 12, 2021

Supported now :-)

@k-ye k-ye closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Suggest an idea on this project
Projects
None yet
Development

No branches or pull requests

5 participants