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

Enable CPU-only builds on macOS #616

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tilmantroester
Copy link

This PR enables CPU-only builds on macOS. It in addition to the changes to spconv, this also requires some changes to ccimport and cumm. They are implemented at https://github.com/tilmantroester/ccimport/tree/macos_support and
https://github.com/tilmantroester/cumm/tree/macos_cpu_only. Let me know if you want PRs for those as well.

I've tested this on an arm64 mac, with both Apple and conda clang.
For development installs (pip install -e), both JIT and non-JIT work. Standard installs require the non-JIT build.

Compiling with OpenMP works but the results are unstable, so I disabled OpenMP on macOS.

tests/test_conv.py passes for the cases where CPU implementations are available (i.e. ConvAlgo.Native but not for example SparseGlobalMaxPool).

@xiaohuang2004
Copy link

xiaohuang2004 commented Nov 22, 2024

Hello, thank you for contribution to macOS. I saw your branch for ccimport and cumm. I try to install ccimport, cumm and spconv.(I git clone all them and then use pip install -e . to install them.) Then I try to run tests/test_conv.py. Unfortunately, it seems that something is wrong in cumm.
Traceback (most recent call last): File "/Users/apple/Desktop/spconv/spconv/test/test_conv.py", line 28, in <module> from spconv.core import ConvAlgo File "/Users/apple/Desktop/spconv/spconv/spconv/__init__.py", line 15, in <module> from . import build as _build File "/Users/apple/Desktop/spconv/spconv/spconv/build.py", line 21, in <module> from .constants import PACKAGE_NAME, PACKAGE_ROOT, DISABLE_JIT, SPCONV_INT8_DEBUG File "/Users/apple/Desktop/spconv/spconv/spconv/constants.py", line 19, in <module> from cumm.gemm.constants import NVRTCMode File "/Users/apple/Desktop/spconv/cumm/cumm/__init__.py", line 28, in <module> pccm.builder.build_pybind([ArrayPtr(), TensorViewBind()], File "/opt/anaconda3/envs/spconv/lib/python3.10/site-packages/pccm/core/__init__.py", line 983, in wrapper func(self, *args, **kwargs) File "/Users/apple/Desktop/spconv/cumm/cumm/tensorview_bind.py", line 51, in __init__ cuda_ver = get_cuda_version_by_nvcc().split(".") File "/Users/apple/Desktop/spconv/cumm/cumm/common.py", line 224, in get_cuda_version_by_nvcc nvcc_version = subprocess.check_output(["nvcc", "--version" File "/opt/anaconda3/envs/spconv/lib/python3.10/subprocess.py", line 421, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/opt/anaconda3/envs/spconv/lib/python3.10/subprocess.py", line 503, in run with Popen(*popenargs, **kwargs) as process: File "/opt/anaconda3/envs/spconv/lib/python3.10/subprocess.py", line 971, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/opt/anaconda3/envs/spconv/lib/python3.10/subprocess.py", line 1863, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'nvcc'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants