From 3cd28092771bc8af4eaaa56d24586c26ca76a3d1 Mon Sep 17 00:00:00 2001 From: HAI Date: Mon, 4 Nov 2024 01:40:57 -0800 Subject: [PATCH] [Docs, ROCm] update install to cover ROCm with MI GPUs (#1915) --- docs/start/install.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/start/install.md b/docs/start/install.md index 57b899da3..7a764f91a 100644 --- a/docs/start/install.md +++ b/docs/start/install.md @@ -7,7 +7,7 @@ You can install SGLang using any of the methods below. pip install --upgrade pip pip install "sglang[all]" -# Install FlashInfer accelerated kernels +# Install FlashInfer accelerated kernels (CUDA only for now) pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ ``` @@ -22,7 +22,7 @@ cd sglang pip install --upgrade pip pip install -e "python[all]" -# Install FlashInfer accelerated kernels +# Install FlashInfer accelerated kernels (CUDA only for now) pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ ``` @@ -42,6 +42,25 @@ docker run --gpus all \ python3 -m sglang.launch_server --model-path meta-llama/Llama-3.1-8B-Instruct --host 0.0.0.0 --port 30000 ``` +Note: To AMD ROCm system with Instinct/MI GPUs, it is recommended to use `docker/Dockerfile.rocm` to build images, example and usage as below: + +```bash +docker build --build-arg SGL_BRANCH=v0.3.5 -t v0.3.5-rocm620 -f Dockerfile.rocm . + +alias drun='docker run -it --rm --network=host --device=/dev/kfd --device=/dev/dri --ipc=host \ + --shm-size 16G --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \ + -v $HOME/dockerx:/dockerx -v /data:/data' + +drun -p 30000:30000 \ + -v ~/.cache/huggingface:/root/.cache/huggingface \ + --env "HF_TOKEN=" \ + v0.3.5-rocm620 \ + python3 -m sglang.launch_server --model-path meta-llama/Llama-3.1-8B-Instruct --host 0.0.0.0 --port 30000 + +# Till flashinfer backend available, --attention-backend triton --sampling-backend pytorch are set by default +drun v0.3.5-rocm620 python3 -m sglang.bench_latency --batch-size 32 --input 1024 --output 128 --model amd/Meta-Llama-3.1-8B-Instruct-FP8-KV --tp 8 --quantization fp8 +``` + ## Method 4: Using docker compose