-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AMD examples with vLLM, Axolotl and Trl (#1693)
Add llama31-service-vllm-amd example [Docs] Added vLLM with AMD example Add AMD examples Update AMD-Axolotl example with official example Add build wheel tasks for AMD examples - Minor updates Add necessary comments in AMD Readme Co-authored-by: Bihan Rana <[email protected]>
- Loading branch information
Showing
12 changed files
with
531 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type: dev-environment | ||
name: dev-vLLM-amd | ||
|
||
image: runpod/pytorch:2.4.0-py3.10-rocm6.1.0-ubuntu22.04 | ||
|
||
env: | ||
- HUGGING_FACE_HUB_TOKEN | ||
|
||
ide: vscode | ||
|
||
resources: | ||
gpu: MI300X | ||
disk: 150GB | ||
|
||
spot_policy: auto |
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,46 @@ | ||
type: task | ||
name: build-vllm-rocm | ||
|
||
image: runpod/pytorch:2.4.0-py3.10-rocm6.1.0-ubuntu22.04 | ||
|
||
env: | ||
- HUGGING_FACE_HUB_TOKEN | ||
- AWS_ACCESS_KEY_ID | ||
- AWS_SECRET_ACCESS_KEY | ||
- AWS_REGION | ||
- BUCKET_NAME | ||
|
||
command: | ||
- apt-get update -y | ||
- apt-get install awscli -y | ||
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID | ||
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY | ||
- aws configure set region $AWS_REGION | ||
- export PATH=/opt/conda/envs/py_3.10/bin:$PATH | ||
- wget https://github.com/ROCm/hipBLAS/archive/refs/tags/rocm-6.1.0.zip | ||
- unzip rocm-6.1.0.zip | ||
- cd hipBLAS-rocm-6.1.0 | ||
- python rmake.py | ||
- cd .. | ||
- git clone https://github.com/vllm-project/vllm.git | ||
- cd vllm | ||
- pip install triton | ||
- pip uninstall torch -y | ||
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1 | ||
- pip install /opt/rocm/share/amd_smi | ||
- pip install --upgrade numba scipy huggingface-hub[cli] | ||
- pip install "numpy<2" | ||
- pip install -r requirements-rocm.txt | ||
- wget -N https://github.com/ROCm/vllm/raw/fa78403/rocm_patch/libamdhip64.so.6 -P /opt/rocm/lib | ||
- rm -f "$(python3 -c 'import torch; print(torch.__path__[0])')"/lib/libamdhip64.so* | ||
- export PYTORCH_ROCM_ARCH="gfx90a;gfx942" | ||
- pip install wheel setuptools setuptools_scm ninja | ||
- python setup.py bdist_wheel -d dist/ | ||
- cd dist | ||
- aws s3 cp "$(ls -1 | head -n 1)" s3://$BUCKET_NAME/ --acl public-read | ||
|
||
spot_policy: auto | ||
|
||
resources: | ||
gpu: MI300X | ||
disk: 150GB |
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,49 @@ | ||
type: service | ||
name: llama31-service-vllm-amd | ||
|
||
image: runpod/pytorch:2.4.0-py3.10-rocm6.1.0-ubuntu22.04 | ||
|
||
env: | ||
- HUGGING_FACE_HUB_TOKEN | ||
- MODEL_ID=meta-llama/Meta-Llama-3.1-70B-Instruct | ||
- MAX_MODEL_LEN=126192 | ||
|
||
commands: | ||
- export PATH=/opt/conda/envs/py_3.10/bin:$PATH | ||
- wget https://github.com/ROCm/hipBLAS/archive/refs/tags/rocm-6.1.0.zip | ||
- unzip rocm-6.1.0.zip | ||
- cd hipBLAS-rocm-6.1.0 | ||
- python rmake.py | ||
- cd .. | ||
- git clone https://github.com/vllm-project/vllm.git | ||
- cd vllm | ||
- pip install triton | ||
- pip uninstall torch -y | ||
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1 | ||
- pip install /opt/rocm/share/amd_smi | ||
- pip install --upgrade numba scipy huggingface-hub[cli] | ||
- pip install "numpy<2" | ||
- pip install -r requirements-rocm.txt | ||
- wget -N https://github.com/ROCm/vllm/raw/fa78403/rocm_patch/libamdhip64.so.6 -P /opt/rocm/lib | ||
- rm -f "$(python3 -c 'import torch; print(torch.__path__[0])')"/lib/libamdhip64.so* | ||
- export PYTORCH_ROCM_ARCH="gfx90a;gfx942" | ||
- wget https://dstack-binaries.s3.amazonaws.com/vllm-0.6.0%2Brocm614-cp310-cp310-linux_x86_64.whl | ||
- pip install vllm-0.6.0+rocm614-cp310-cp310-linux_x86_64.whl | ||
- vllm serve $MODEL_ID | ||
--max-model-len $MAX_MODEL_LEN | ||
--port 8000 | ||
|
||
# Expose the vllm server port | ||
port: 8000 | ||
|
||
spot_policy: auto | ||
|
||
resources: | ||
gpu: MI300X | ||
disk: 200GB | ||
|
||
# (Optional) Enable the OpenAI-compatible endpoint | ||
model: | ||
format: openai | ||
type: chat | ||
name: meta-llama/Meta-Llama-3.1-70B-Instruct |
Oops, something went wrong.