-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Hardware][Apple] Native support for macOS Apple Silicon #11696
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ad37042
[Hardware][Apple] MacOs installation setup
wallashss dd78661
refactoring cpu cmake extension
wallashss 0077749
Update csrc/cpu/cpu_types_arm.hpp
wallashss c432632
workaround to run server
wallashss b597f2c
Merge branch 'main' into mac-install
wallashss 36e6e18
docs for mac install
wallashss a81634b
Update docs/source/getting_started/installation/cpu-apple.md
wallashss 79a52dc
updated docs and added TODO
wallashss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
(apple-install)= | ||
wallashss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Installation for macOS | ||
|
||
vLLM has experimental support for macOS with Apple Silicon. For now, users shall build from the source vLLM to natively run on macOS. For more details, like running on vLLM in a docker container, see [ARM CPU Documentation](installation-arm) | ||
|
||
Currently the CPU implementation for macOS supports FP32 and FP16 datatypes. | ||
|
||
## Requirements | ||
|
||
- **Operating System**: `macOS Sonoma` or later | ||
- **SDK** `XCode 15.4` or later with Command Line Tools | ||
- **Compilers**: `Apple Clang >= 15.0.0` | ||
|
||
<!-- (arm-backend-quick-start-dockerfile)= --> | ||
|
||
## Build and installation | ||
|
||
After installation of XCode and the Command Line Tools, which include Apple Clang, execute the following commands to build and install vLLM from the source. | ||
|
||
``` | ||
$ git clone https://github.com/vllm-project/vllm.git | ||
$ cd vllm | ||
$ pip install -r requirements-cpu.txt | ||
$ pip install -e . | ||
``` | ||
|
||
```{note} | ||
On macOS the `VLLM_TARGET_DEVICE` is automatically set to `cpu`, which currently is the only supported device. | ||
``` | ||
|
||
|
||
|
||
## Troubleshooting | ||
|
||
If the build has error like the following snippet, try to remove and reinstall the command line tools. | ||
wallashss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
[...] fatal error: 'map' file not found | ||
1 | #include <map> | ||
| ^~~~~ | ||
1 error generated. | ||
[2/8] Building CXX object CMakeFiles/_C.dir/csrc/cpu/pos_encoding.cpp.o | ||
|
||
[...] fatal error: 'cstddef' file not found | ||
10 | #include <cstddef> | ||
| ^~~~~~~~~ | ||
1 error generated. | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ gpu-cuda | |
gpu-rocm | ||
cpu-x86 | ||
cpu-arm | ||
cpu-apple | ||
hpu-gaudi | ||
tpu | ||
xpu | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't apple silicon already match
ASIMD_FOUND
above? This is at least what happens when you build in a docker on apple siliconThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mgoin, thank you for checking this!
I had second thoughts and I changed this detection on CMake.
The problem that I found is we can not run
cat /proc/cpuinfo
to get CPU info on Mac OS. So, my first approach was to change the command to useuname -m
, trying to keep the same pattern. But using only the built-in variables from CMake we can detect more easy and I think more robust as well.