-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Build Triton on MacOS with Apple silicon. #3443
Comments
Linux and macOS use different processor/ISA string identifiers for their ARM64 variants. So the macOS build was falling thru in cmake config, then later trying to link against x86 libraries and failing to find them in the LLVM librarries bundle for macOS-ARM.
Linux and macOS use different processor/ISA string identifiers for their ARM64 variants. So the macOS build was falling thru in cmake config, then later trying to link against x86 libraries and failing to find them in the LLVM libraries bundle for macOS-ARM.
…riton-lang#3444) Linux and macOS use different processor/ISA string identifiers for their ARM64 variants. So the macOS build was falling thru in cmake config, then later trying to link against x86 libraries and failing to find them in the LLVM libraries bundle for macOS-ARM.
I can confirm. This fixed my ninja build ninja: build stopped: subcommand failed.
After pulling in the latest main, I am able to build with ninja. `Successfully built triton llnl-hatchet Installing collected packages: Arpeggio, pydot, importlib-metadata, caliper-reader, textX, llnl-hatchet, triton |
I attempted to build triton wheel for macOS on a MacBook with M2 Max chip and the build fails.
Local config: M2 Max, macOS 14.4, Python 3.12.2, with all the project-specific python library dependencies installed.
The error I ran into is
I root caused the issue to the cmake config where 'CMAKE_SYSTEM_PROCESSOR' is used to decide whether to take dependency on x86 or aarch64 variants of LLVM library dependencies. Linux and MacOS use different strings for identifying their ARM processor/isa, "aarch64" and "arm64" respectively. So the macOS build currently fails that check, selects the x86 libraries then later fails to find them in the downloaded LLVM libraries bundle.
The fix is to expand the cmake check to account for both. I will submit a PR for it shortly.
With this change, I am able to successfully compile and install triton on my Mac. It passed the ninja and lit unit tests outlined in readme file. I tried to run some of the core unit tests and tutorials, and they asserted (as expected) on either PyTorch not compiled for CUDA, or number of active GPU drivers is not 1. As a sanity check, I spun up an ubuntu container instance on my Mac and successfully compiled for aarch64, installed, and passed the ninja/lit unit tests.
Lastly, I am aware that macOS isn't a supported platform and neither are Apple silicon GPUs at this time. So even getting a working build doesn't unlock all the supported capabilities of the language and compiler. But I wanted to have some native local triton support to the hardware-agnostic aspects as I experiment with and learn Triton.
The text was updated successfully, but these errors were encountered: