-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add vLLM TPU example and update TPU readme
Change optimum-tpu fork from bihan to dstack repo
- Loading branch information
Bihan Rana
authored and
Bihan Rana
committed
Sep 1, 2024
1 parent
44c0da0
commit 96ad111
Showing
12 changed files
with
212 additions
and
50 deletions.
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
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,41 @@ | ||
type: service | ||
# The name is optional, if not specified, generated randomly | ||
name: llama31-service-vLLM | ||
|
||
env: | ||
- MODEL_ID=meta-llama/Meta-Llama-3.1-8B-Instruct | ||
- HUGGING_FACE_HUB_TOKEN | ||
- DATE=20240828 | ||
- TORCH_VERSION=2.5.0 | ||
- VLLM_TARGET_DEVICE=tpu | ||
- MAX_MODEL_LEN=4096 | ||
|
||
commands: | ||
- pip install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-${TORCH_VERSION}.dev${DATE}-cp311-cp311-linux_x86_64.whl | ||
- pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-${TORCH_VERSION}.dev${DATE}-cp311-cp311-linux_x86_64.whl | ||
- pip install torch_xla[tpu] -f https://storage.googleapis.com/libtpu-releases/index.html | ||
- pip install torch_xla[pallas] -f https://storage.googleapis.com/jax-releases/jax_nightly_releases.html -f https://storage.googleapis.com/jax-releases/jaxlib_nightly_releases.html | ||
- git clone https://github.com/vllm-project/vllm.git | ||
- cd vllm | ||
- pip install -r requirements-tpu.txt | ||
- apt-get install -y libopenblas-base libopenmpi-dev libomp-dev | ||
- python setup.py develop | ||
- vllm serve $MODEL_ID | ||
--tensor-parallel-size 8 | ||
--max-model-len $MAX_MODEL_LEN | ||
--port 8000 | ||
|
||
# Expose the vllm server port | ||
port: | ||
- 8000 | ||
|
||
spot_policy: auto | ||
|
||
resources: | ||
gpu: v5litepod-8 | ||
|
||
# (Optional) Enable the OpenAI-compatible endpoint | ||
model: | ||
format: openai | ||
type: chat | ||
name: meta-llama/Meta-Llama-3.1-8B |
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.