[Doc] Switch K8S examples to default MP mode (#39400)
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io> Signed-off-by: Peter Pan <peter.pan@daocloud.io> Signed-off-by: Kyle Sayers <kylesayrs@gmail.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Kyle Sayers <kylesayrs@gmail.com> Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
co-authored by
Harry Mellor
Kyle Sayers
Flora Feng
parent
ffce72c041
commit
3d300aecb1
+220
-106
@@ -7,108 +7,202 @@ vLLM can be deployed with [LWS](https://github.com/kubernetes-sigs/lws) on Kuber
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
* At least two Kubernetes nodes, each with 8 GPUs, are required.
|
- At least two Kubernetes nodes, each with 8 GPUs, are required.
|
||||||
* Install LWS by following the instructions found [here](https://lws.sigs.k8s.io/docs/installation/).
|
- Install LWS by following the instructions found [here](https://lws.sigs.k8s.io/docs/installation/).
|
||||||
|
|
||||||
## Deploy and Serve
|
## Deploy and Serve
|
||||||
|
|
||||||
Deploy the following yaml file `lws.yaml`
|
Deploy the following yaml file `lws.yaml` (we have examples that use multiprocessing or Ray):
|
||||||
|
|
||||||
??? code "Yaml"
|
??? code "lws.yaml"
|
||||||
|
=== "Multiprocessing (default)"
|
||||||
|
```yaml
|
||||||
|
apiVersion: leaderworkerset.x-k8s.io/v1
|
||||||
|
kind: LeaderWorkerSet
|
||||||
|
metadata:
|
||||||
|
name: vllm
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
leaderWorkerTemplate:
|
||||||
|
size: 2
|
||||||
|
restartPolicy: RecreateGroupOnPodRestart
|
||||||
|
leaderTemplate:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
role: leader
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: vllm-leader
|
||||||
|
image: docker.io/vllm/vllm-openai:latest
|
||||||
|
env:
|
||||||
|
- name: HF_TOKEN
|
||||||
|
value: <your-hf-token>
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- "vllm serve meta-llama/Meta-Llama-3.1-405B-Instruct --tensor-parallel-size 8 --pipeline-parallel-size $(LWS_GROUP_SIZE) --nnodes $(LWS_GROUP_SIZE) --node-rank $(LWS_WORKER_INDEX) --master-addr $(LWS_LEADER_ADDRESS) --port 8080"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: "8"
|
||||||
|
memory: 1124Gi
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
requests:
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
cpu: 125
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 10
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /dev/shm
|
||||||
|
name: dshm
|
||||||
|
volumes:
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
sizeLimit: 15Gi
|
||||||
|
workerTemplate:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: vllm-worker
|
||||||
|
image: docker.io/vllm/vllm-openai:latest
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- "vllm serve meta-llama/Meta-Llama-3.1-405B-Instruct --tensor-parallel-size 8 --pipeline-parallel-size $(LWS_GROUP_SIZE) --nnodes $(LWS_GROUP_SIZE) --node-rank $(LWS_WORKER_INDEX) --master-addr $(LWS_LEADER_ADDRESS) --headless"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: "8"
|
||||||
|
memory: 1124Gi
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
requests:
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
cpu: 125
|
||||||
|
env:
|
||||||
|
- name: HF_TOKEN
|
||||||
|
value: <your-hf-token>
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /dev/shm
|
||||||
|
name: dshm
|
||||||
|
volumes:
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
sizeLimit: 15Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: vllm-leader
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 8080
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
leaderworkerset.sigs.k8s.io/name: vllm
|
||||||
|
role: leader
|
||||||
|
type: ClusterIP
|
||||||
|
```
|
||||||
|
|
||||||
```yaml
|
=== "Ray"
|
||||||
apiVersion: leaderworkerset.x-k8s.io/v1
|
```yaml
|
||||||
kind: LeaderWorkerSet
|
apiVersion: leaderworkerset.x-k8s.io/v1
|
||||||
metadata:
|
kind: LeaderWorkerSet
|
||||||
name: vllm
|
metadata:
|
||||||
spec:
|
name: vllm
|
||||||
replicas: 1
|
spec:
|
||||||
leaderWorkerTemplate:
|
replicas: 1
|
||||||
size: 2
|
leaderWorkerTemplate:
|
||||||
restartPolicy: RecreateGroupOnPodRestart
|
size: 2
|
||||||
leaderTemplate:
|
restartPolicy: RecreateGroupOnPodRestart
|
||||||
metadata:
|
leaderTemplate:
|
||||||
labels:
|
metadata:
|
||||||
role: leader
|
labels:
|
||||||
spec:
|
role: leader
|
||||||
containers:
|
spec:
|
||||||
- name: vllm-leader
|
containers:
|
||||||
image: docker.io/vllm/vllm-openai:latest
|
- name: vllm-leader
|
||||||
env:
|
image: docker.io/vllm/vllm-openai:latest
|
||||||
- name: HF_TOKEN
|
env:
|
||||||
value: <your-hf-token>
|
- name: HF_TOKEN
|
||||||
command:
|
value: <your-hf-token>
|
||||||
- sh
|
command:
|
||||||
- -c
|
- sh
|
||||||
- "bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh leader --ray_cluster_size=$(LWS_GROUP_SIZE);
|
- -c
|
||||||
vllm serve meta-llama/Meta-Llama-3.1-405B-Instruct --port 8080 --tensor-parallel-size 8 --pipeline_parallel_size 2"
|
- "bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh leader --ray_cluster_size=$(LWS_GROUP_SIZE);
|
||||||
resources:
|
vllm serve meta-llama/Meta-Llama-3.1-405B-Instruct --port 8080 --tensor-parallel-size 8 --pipeline-parallel-size 2 --distributed-executor-backend ray"
|
||||||
limits:
|
resources:
|
||||||
nvidia.com/gpu: "8"
|
limits:
|
||||||
memory: 1124Gi
|
nvidia.com/gpu: "8"
|
||||||
ephemeral-storage: 800Gi
|
memory: 1124Gi
|
||||||
requests:
|
ephemeral-storage: 800Gi
|
||||||
ephemeral-storage: 800Gi
|
requests:
|
||||||
cpu: 125
|
ephemeral-storage: 800Gi
|
||||||
ports:
|
cpu: 125
|
||||||
- containerPort: 8080
|
ports:
|
||||||
readinessProbe:
|
- containerPort: 8080
|
||||||
tcpSocket:
|
readinessProbe:
|
||||||
port: 8080
|
tcpSocket:
|
||||||
initialDelaySeconds: 15
|
port: 8080
|
||||||
periodSeconds: 10
|
initialDelaySeconds: 15
|
||||||
volumeMounts:
|
periodSeconds: 10
|
||||||
- mountPath: /dev/shm
|
volumeMounts:
|
||||||
name: dshm
|
- mountPath: /dev/shm
|
||||||
volumes:
|
name: dshm
|
||||||
- name: dshm
|
volumes:
|
||||||
emptyDir:
|
- name: dshm
|
||||||
medium: Memory
|
emptyDir:
|
||||||
sizeLimit: 15Gi
|
medium: Memory
|
||||||
workerTemplate:
|
sizeLimit: 15Gi
|
||||||
spec:
|
workerTemplate:
|
||||||
containers:
|
spec:
|
||||||
- name: vllm-worker
|
containers:
|
||||||
image: docker.io/vllm/vllm-openai:latest
|
- name: vllm-worker
|
||||||
command:
|
image: docker.io/vllm/vllm-openai:latest
|
||||||
- sh
|
command:
|
||||||
- -c
|
- sh
|
||||||
- "bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh worker --ray_address=$(LWS_LEADER_ADDRESS)"
|
- -c
|
||||||
resources:
|
- "bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh worker --ray_address=$(LWS_LEADER_ADDRESS)"
|
||||||
limits:
|
resources:
|
||||||
nvidia.com/gpu: "8"
|
limits:
|
||||||
memory: 1124Gi
|
nvidia.com/gpu: "8"
|
||||||
ephemeral-storage: 800Gi
|
memory: 1124Gi
|
||||||
requests:
|
ephemeral-storage: 800Gi
|
||||||
ephemeral-storage: 800Gi
|
requests:
|
||||||
cpu: 125
|
ephemeral-storage: 800Gi
|
||||||
env:
|
cpu: 125
|
||||||
- name: HF_TOKEN
|
env:
|
||||||
value: <your-hf-token>
|
- name: HF_TOKEN
|
||||||
volumeMounts:
|
value: <your-hf-token>
|
||||||
- mountPath: /dev/shm
|
volumeMounts:
|
||||||
name: dshm
|
- mountPath: /dev/shm
|
||||||
volumes:
|
name: dshm
|
||||||
- name: dshm
|
volumes:
|
||||||
emptyDir:
|
- name: dshm
|
||||||
medium: Memory
|
emptyDir:
|
||||||
sizeLimit: 15Gi
|
medium: Memory
|
||||||
---
|
sizeLimit: 15Gi
|
||||||
apiVersion: v1
|
---
|
||||||
kind: Service
|
apiVersion: v1
|
||||||
metadata:
|
kind: Service
|
||||||
name: vllm-leader
|
metadata:
|
||||||
spec:
|
name: vllm-leader
|
||||||
ports:
|
spec:
|
||||||
- name: http
|
ports:
|
||||||
port: 8080
|
- name: http
|
||||||
protocol: TCP
|
port: 8080
|
||||||
targetPort: 8080
|
protocol: TCP
|
||||||
selector:
|
targetPort: 8080
|
||||||
leaderworkerset.sigs.k8s.io/name: vllm
|
selector:
|
||||||
role: leader
|
leaderworkerset.sigs.k8s.io/name: vllm
|
||||||
type: ClusterIP
|
role: leader
|
||||||
```
|
type: ClusterIP
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f lws.yaml
|
kubectl apply -f lws.yaml
|
||||||
@@ -130,16 +224,37 @@ vllm-0-1 1/1 Running 0 2s
|
|||||||
|
|
||||||
Verify that the distributed tensor-parallel inference works:
|
Verify that the distributed tensor-parallel inference works:
|
||||||
|
|
||||||
```bash
|
=== "Multiprocessing (default)"
|
||||||
kubectl logs vllm-0 |grep -i "Loading model weights took"
|
```bash
|
||||||
```
|
kubectl logs vllm-0 | grep -i "Model loading"
|
||||||
|
kubectl logs vllm-0-1 | grep -i "Model loading"
|
||||||
|
```
|
||||||
|
|
||||||
Should get something similar to this:
|
Should get something similar to this:
|
||||||
|
|
||||||
```text
|
POD 0 (PP Rank 0)
|
||||||
INFO 05-08 03:20:24 model_runner.py:173] Loading model weights took 0.1189 GB
|
|
||||||
(RayWorkerWrapper pid=169, ip=10.20.0.197) INFO 05-08 03:20:28 model_runner.py:173] Loading model weights took 0.1189 GB
|
```text
|
||||||
```
|
(Worker_PP0_TP0 pid=601) INFO 04-28 08:16:58 [gpu_model_runner.py:4820] Model loading took 3.82 GiB memory and 157.996399 seconds
|
||||||
|
```
|
||||||
|
|
||||||
|
POD 1 (PP Rank 1)
|
||||||
|
|
||||||
|
```text
|
||||||
|
(Worker_PP1_TP0 pid=396) INFO 04-28 08:17:09 [gpu_model_runner.py:4820] Model loading took 3.82 GiB memory and 168.878781 seconds
|
||||||
|
```
|
||||||
|
|
||||||
|
=== "Ray"
|
||||||
|
```bash
|
||||||
|
kubectl logs vllm-0 | grep -i "Loading model weights took"
|
||||||
|
```
|
||||||
|
|
||||||
|
Should get something similar to this:
|
||||||
|
|
||||||
|
```text
|
||||||
|
INFO 05-08 03:20:24 model_runner.py:173] Loading model weights took 0.1189 GB
|
||||||
|
(RayWorkerWrapper pid=169, ip=10.20.0.197) INFO 05-08 03:20:28 model_runner.py:173] Loading model weights took 0.1189 GB
|
||||||
|
```
|
||||||
|
|
||||||
## Access ClusterIP service
|
## Access ClusterIP service
|
||||||
|
|
||||||
@@ -173,7 +288,6 @@ curl http://localhost:8080/v1/completions \
|
|||||||
The output should be similar to the following
|
The output should be similar to the following
|
||||||
|
|
||||||
??? console "Output"
|
??? console "Output"
|
||||||
|
|
||||||
```text
|
```text
|
||||||
{
|
{
|
||||||
"id": "cmpl-1bb34faba88b43f9862cfbfb2200949d",
|
"id": "cmpl-1bb34faba88b43f9862cfbfb2200949d",
|
||||||
|
|||||||
@@ -64,36 +64,74 @@ A simplified version of the example (`llama-multinode`) looks like:
|
|||||||
- `spec.replicas: 1` – one `ServingGroup` (one logical model deployment).
|
- `spec.replicas: 1` – one `ServingGroup` (one logical model deployment).
|
||||||
- `roles`:
|
- `roles`:
|
||||||
- `entryTemplate` – defines **leader** pods that run:
|
- `entryTemplate` – defines **leader** pods that run:
|
||||||
- vLLM’s **multi-node cluster bootstrap script** (Ray cluster).
|
- vLLM’s **multi-node cluster bootstrap script**.
|
||||||
- vLLM **OpenAI-compatible API server**.
|
- vLLM **OpenAI-compatible API server**.
|
||||||
- `workerTemplate` – defines **worker** pods that join the leader’s Ray cluster.
|
- `workerTemplate` – defines **worker** pods to join the leader’s Ray cluster (Ray backend) or to join same distributed process group (multiprocessing backend).
|
||||||
|
|
||||||
Key points from the example YAML:
|
Key points from the example YAML:
|
||||||
|
|
||||||
- **Image**: `vllm/vllm-openai:latest` (matches upstream vLLM images).
|
Image: `vllm/vllm-openai:latest` (matches upstream vLLM images).
|
||||||
- **Command** (leader):
|
Commands:
|
||||||
|
|
||||||
```yaml
|
??? code "Yaml"
|
||||||
command:
|
=== "Multiprocessing (default)"
|
||||||
- sh
|
Leader:
|
||||||
- -c
|
|
||||||
- >
|
|
||||||
bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh leader --ray_cluster_size=2;
|
|
||||||
vllm serve meta-llama/Llama-3.1-405B-Instruct
|
|
||||||
--port 8080
|
|
||||||
--tensor-parallel-size 8
|
|
||||||
--pipeline-parallel-size 2
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Command** (worker):
|
```yaml
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
vllm serve meta-llama/Llama-3.1-405B-Instruct
|
||||||
|
--tensor-parallel-size 8
|
||||||
|
--pipeline-parallel-size 2
|
||||||
|
--nnodes=2
|
||||||
|
--node-rank=0
|
||||||
|
--master-addr=$(ENTRY_ADDRESS)
|
||||||
|
--port 8080
|
||||||
|
```
|
||||||
|
|
||||||
```yaml
|
Worker:
|
||||||
command:
|
|
||||||
- sh
|
```yaml
|
||||||
- -c
|
command:
|
||||||
- >
|
- sh
|
||||||
bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh worker --ray_address=$(ENTRY_ADDRESS)
|
- -c
|
||||||
```
|
- >
|
||||||
|
vllm serve meta-llama/Llama-3.1-405B-Instruct
|
||||||
|
--tensor-parallel-size 8
|
||||||
|
--pipeline-parallel-size 2
|
||||||
|
--nnodes=2
|
||||||
|
--node-rank=1
|
||||||
|
--master-addr=$(ENTRY_ADDRESS)
|
||||||
|
--headless
|
||||||
|
```
|
||||||
|
|
||||||
|
=== "Ray"
|
||||||
|
Leader:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh
|
||||||
|
leader --ray_cluster_size=2; python3 -m
|
||||||
|
vllm.entrypoints.openai.api_server --port 8080 --model
|
||||||
|
meta-llama/Llama-3.1-405B-Instruct --tensor-parallel-size 8
|
||||||
|
--pipeline-parallel-size 2
|
||||||
|
```
|
||||||
|
|
||||||
|
Worker:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh
|
||||||
|
worker --ray_address=$(ENTRY_ADDRESS)
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -111,96 +149,192 @@ kubectl create secret generic hf-token \
|
|||||||
|
|
||||||
### 3.2 Apply the `ModelServing`
|
### 3.2 Apply the `ModelServing`
|
||||||
|
|
||||||
|
Save one of the following manifests to `modelserving.yaml`:
|
||||||
|
|
||||||
|
??? code "modelserving.yaml"
|
||||||
|
=== "Multiprocessing (default)"
|
||||||
|
```yaml
|
||||||
|
apiVersion: workload.serving.volcano.sh/v1alpha1
|
||||||
|
kind: ModelServing
|
||||||
|
metadata:
|
||||||
|
name: llama-multinode
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
schedulerName: volcano
|
||||||
|
replicas: 1 # group replicas
|
||||||
|
template:
|
||||||
|
restartGracePeriodSeconds: 60
|
||||||
|
gangPolicy:
|
||||||
|
minRoleReplicas:
|
||||||
|
405b: 1
|
||||||
|
roles:
|
||||||
|
- name: 405b
|
||||||
|
replicas: 2
|
||||||
|
entryTemplate:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: leader
|
||||||
|
image: vllm/vllm-openai:latest
|
||||||
|
env:
|
||||||
|
- name: HUGGING_FACE_HUB_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: hf-token
|
||||||
|
key: HUGGING_FACE_HUB_TOKEN
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- "vllm serve meta-llama/Llama-3.1-405B-Instruct --tensor-parallel-size 8 --pipeline-parallel-size 2 --nnodes 2 --node-rank 0 --master-addr $(ENTRY_ADDRESS) --distributed-executor-backend mp --port 8080"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: "8"
|
||||||
|
memory: 1124Gi
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
requests:
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
cpu: 125
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 10
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /dev/shm
|
||||||
|
name: dshm
|
||||||
|
volumes:
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
sizeLimit: 15Gi
|
||||||
|
workerReplicas: 1
|
||||||
|
workerTemplate:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: worker
|
||||||
|
image: vllm/vllm-openai:latest
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- "vllm serve meta-llama/Llama-3.1-405B-Instruct --tensor-parallel-size 8 --pipeline-parallel-size 2 --nnodes 2 --node-rank 1 --master-addr $(ENTRY_ADDRESS) --distributed-executor-backend mp --headless"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: "8"
|
||||||
|
memory: 1124Gi
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
requests:
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
cpu: 125
|
||||||
|
env:
|
||||||
|
- name: HUGGING_FACE_HUB_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: hf-token
|
||||||
|
key: HUGGING_FACE_HUB_TOKEN
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /dev/shm
|
||||||
|
name: dshm
|
||||||
|
volumes:
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
sizeLimit: 15Gi
|
||||||
|
```
|
||||||
|
|
||||||
|
=== "Ray"
|
||||||
|
```yaml
|
||||||
|
apiVersion: workload.serving.volcano.sh/v1alpha1
|
||||||
|
kind: ModelServing
|
||||||
|
metadata:
|
||||||
|
name: llama-multinode
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
schedulerName: volcano
|
||||||
|
replicas: 1 # group replicas
|
||||||
|
template:
|
||||||
|
restartGracePeriodSeconds: 60
|
||||||
|
gangPolicy:
|
||||||
|
minRoleReplicas:
|
||||||
|
405b: 1
|
||||||
|
roles:
|
||||||
|
- name: 405b
|
||||||
|
replicas: 2
|
||||||
|
entryTemplate:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: leader
|
||||||
|
image: vllm/vllm-openai:latest
|
||||||
|
env:
|
||||||
|
- name: HUGGING_FACE_HUB_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: hf-token
|
||||||
|
key: HUGGING_FACE_HUB_TOKEN
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- "bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh leader --ray_cluster_size=2;
|
||||||
|
vllm serve meta-llama/Llama-3.1-405B-Instruct --port 8080 --tensor-parallel-size 8 --pipeline-parallel-size 2"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: "8"
|
||||||
|
memory: 1124Gi
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
requests:
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
cpu: 125
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 10
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /dev/shm
|
||||||
|
name: dshm
|
||||||
|
volumes:
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
sizeLimit: 15Gi
|
||||||
|
workerReplicas: 1
|
||||||
|
workerTemplate:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: worker
|
||||||
|
image: vllm/vllm-openai:latest
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- "bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh worker --ray_address=$(ENTRY_ADDRESS)"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: "8"
|
||||||
|
memory: 1124Gi
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
requests:
|
||||||
|
ephemeral-storage: 800Gi
|
||||||
|
cpu: 125
|
||||||
|
env:
|
||||||
|
- name: HUGGING_FACE_HUB_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: hf-token
|
||||||
|
key: HUGGING_FACE_HUB_TOKEN
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /dev/shm
|
||||||
|
name: dshm
|
||||||
|
volumes:
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
sizeLimit: 15Gi
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cat <<EOF | kubectl apply -f -
|
kubectl apply -f modelserving.yaml
|
||||||
apiVersion: workload.serving.volcano.sh/v1alpha1
|
|
||||||
kind: ModelServing
|
|
||||||
metadata:
|
|
||||||
name: llama-multinode
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
schedulerName: volcano
|
|
||||||
replicas: 1 # group replicas
|
|
||||||
template:
|
|
||||||
restartGracePeriodSeconds: 60
|
|
||||||
gangPolicy:
|
|
||||||
minRoleReplicas:
|
|
||||||
405b: 1
|
|
||||||
roles:
|
|
||||||
- name: 405b
|
|
||||||
replicas: 2
|
|
||||||
entryTemplate:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: leader
|
|
||||||
image: vllm/vllm-openai:latest
|
|
||||||
env:
|
|
||||||
- name: HUGGING_FACE_HUB_TOKEN
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: hf-token
|
|
||||||
key: HUGGING_FACE_HUB_TOKEN
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- "bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh leader --ray_cluster_size=2;
|
|
||||||
vllm serve meta-llama/Llama-3.1-405B-Instruct --port 8080 --tensor-parallel-size 8 --pipeline-parallel-size 2"
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
nvidia.com/gpu: "8"
|
|
||||||
memory: 1124Gi
|
|
||||||
ephemeral-storage: 800Gi
|
|
||||||
requests:
|
|
||||||
ephemeral-storage: 800Gi
|
|
||||||
cpu: 125
|
|
||||||
ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
readinessProbe:
|
|
||||||
tcpSocket:
|
|
||||||
port: 8080
|
|
||||||
initialDelaySeconds: 15
|
|
||||||
periodSeconds: 10
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /dev/shm
|
|
||||||
name: dshm
|
|
||||||
volumes:
|
|
||||||
- name: dshm
|
|
||||||
emptyDir:
|
|
||||||
medium: Memory
|
|
||||||
sizeLimit: 15Gi
|
|
||||||
workerReplicas: 1
|
|
||||||
workerTemplate:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: worker
|
|
||||||
image: vllm/vllm-openai:latest
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- "bash /vllm-workspace/examples/ray_serving/multi-node-serving.sh worker --ray_address=$(ENTRY_ADDRESS)"
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
nvidia.com/gpu: "8"
|
|
||||||
memory: 1124Gi
|
|
||||||
ephemeral-storage: 800Gi
|
|
||||||
requests:
|
|
||||||
ephemeral-storage: 800Gi
|
|
||||||
cpu: 125
|
|
||||||
env:
|
|
||||||
- name: HUGGING_FACE_HUB_TOKEN
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: hf-token
|
|
||||||
key: HUGGING_FACE_HUB_TOKEN
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /dev/shm
|
|
||||||
name: dshm
|
|
||||||
volumes:
|
|
||||||
- name: dshm
|
|
||||||
emptyDir:
|
|
||||||
medium: Memory
|
|
||||||
sizeLimit: 15Gi
|
|
||||||
EOF
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Kthena will:
|
Kthena will:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# Example usage:
|
# Example usage:
|
||||||
# On the head node machine, start the Ray head node process and run a vLLM server.
|
# On the head node machine, start the Ray head node process and run a vLLM server.
|
||||||
# ./multi-node-serving.sh leader --ray_port=6379 --ray_cluster_size=<SIZE> [<extra ray args>] && \
|
# ./multi-node-serving.sh leader --ray_port=6379 --ray_cluster_size=<SIZE> [<extra ray args>] && \
|
||||||
# vllm serve meta-llama/Meta-Llama-3.1-405B-Instruct --port 8080 --tensor-parallel-size 8 --pipeline_parallel_size 2
|
# vllm serve meta-llama/Meta-Llama-3.1-405B-Instruct --port 8080 --tensor-parallel-size 8 --pipeline-parallel-size 2 --distributed-executor-backend ray
|
||||||
#
|
#
|
||||||
# On each worker node, start the Ray worker node process.
|
# On each worker node, start the Ray worker node process.
|
||||||
# ./multi-node-serving.sh worker --ray_address=<HEAD_NODE_IP> --ray_port=6379 [<extra ray args>]
|
# ./multi-node-serving.sh worker --ray_address=<HEAD_NODE_IP> --ray_port=6379 [<extra ray args>]
|
||||||
|
|||||||
Reference in New Issue
Block a user