facebookresearch / xformers

Hackable and optimized Transformers building blocks, supporting a composable construction.
https://facebookresearch.github.io/xformers/
Other
8.61k stars 611 forks source link

OSX arm64 support for M2 #858

Open kevinkirkup opened 1 year ago

kevinkirkup commented 1 year ago

🚀 Feature

Python package support for OSX arm64 target Arch

Motivation

I'd like to run this locally on Apple Silicone M1/M2 Macs

Pitch

A majority of new developers will be using Macs for development. All new Apple Mac/Macbooks are using either M1 or M2 with arm64 architectures.

Alternatives

None.

Additional context

Apple LLVM version doesn't support -fopenmp build option.

clang: error: unsupported option '-fopenmp'
danthe3rd commented 1 year ago

Hi, Most of the performance improvements in xFormers come from optimized CUDA kernels. Adding support for M1/M2 would require to rewrite most of that from scratch, and that's unfortunately not something we plan on doing (and also requires a slightly different expertise)

rovo79 commented 1 year ago

Might be helpful to add a note to the README.md that Apple M1/M2 not supported.

danthe3rd commented 1 year ago

Good point - I'll add this to my todo-list

rovo79 commented 1 year ago

@danthe3rd I made a PR for you... hopefully you don't have to add it to your todo-list :)