Перейти к основному содержимому

Для чистого Markdown-контента этой страницы добавьте .md к этому URL. Полный индекс документации см. в https://docs.nvidia.com/dynamo/llms.txt. Полный контент, включая API reference и примеры SDK, см. в https://docs.nvidia.com/dynamo/llms-full.txt.

Google Kubernetes Engine (GKE)

Развертывание Dynamo в GKE

Предварительные требования

Установите gcloud CLI

https://cloud.google.com/sdk/docs/install

Создайте кластер GKE

export PROJECT_ID=<>
export REGION=<>
export ZONE=<>
export CLUSTER_NAME=<>
export CLUSTER_MACHINE_TYPE=n2-standard-4
export NODE_POOL_MACHINE_TYPE=g2-standard-24
export GPU_TYPE=nvidia-l4
export GPU_COUNT=2
export CPU_NODE=2
export GPU_NODE=2
export DISK_SIZE=200

gcloud container clusters create ${CLUSTER_NAME} \
--project=${PROJECT_ID} \
--location=${ZONE} \
--subnetwork=default \
--disk-size=${DISK_SIZE} \
--machine-type=${CLUSTER_MACHINE_TYPE} \
--num-nodes=${CPU_NODE}

Создайте пул GPU

gcloud container node-pools create gpu-pool \
--accelerator type=${GPU_TYPE},count=${GPU_COUNT},gpu-driver-version=latest \
--project=${PROJECT_ID} \
--location=${ZONE} \
--cluster=${CLUSTER_NAME} \
--machine-type=${NODE_POOL_MACHINE_TYPE} \
--disk-size=${DISK_SIZE} \
--num-nodes=${GPU_NODE} \
--enable-autoscaling \
--min-nodes=1 \
--max-nodes=3

Клонируйте репозиторий Dynamo на GitHub

Примечание: Убедитесь, что ветка/коммит в GitHub совпадает с платформой Dynamo и контейнером VLLM.

git clone https://github.com/ai-dynamo/dynamo.git

# Checkout to the desired branch
git checkout release/0.6.0

Задайте переменные окружения для GKE

export NAMESPACE=dynamo-system
kubectl create namespace $NAMESPACE
kubectl config set-context --current --namespace=$NAMESPACE

export HF_TOKEN=<HF_TOKEN>
kubectl create secret generic hf-token-secret \
--from-literal=HF_TOKEN=${HF_TOKEN} \
-n ${NAMESPACE}

Установите Dynamo Kubernetes Platform

См. шаги установки

После установки проверьте ее:

Ожидаемый вывод

kubectl get pods
NAME READY STATUS RESTARTS AGE
dynamo-platform-dynamo-operator-controller-manager-69b9794fpgv9 2/2 Running 0 4m27s
dynamo-platform-etcd-0 1/1 Running 0 4m27s
dynamo-platform-nats-0 2/2 Running 0 4m27s

Разверните граф инференса

Мы развернем LLM-модель в платформе Dynamo. В качестве примера здесь используется модель Qwen/Qwen3-0.6B с VLLM и disaggregated deployment.

В yaml-файле развертывания некоторые настройки нужно или можно изменить:

  • (Обязательно) Добавить args для изменения LD_LIBRARY_PATH и PATH контейнера decoder, чтобы GKE мог найти правильный GPU-драйвер
  • Изменить image VLLM на нужный image в NGC
  • Добавить namespace в metadata
  • Скорректировать requests и limits для GPU/CPU
  • Изменить модель для развертывания

Дополнительные конфигурации см. в https://github.com/ai-dynamo/dynamo/tree/v1.2.0/examples/deployments/GKE/vllm

Подсвеченные конфигурации в yaml-файле

Обратите внимание, что LD_LIBRARY_PATH в GKE нужно задать корректно согласно Run GPUs in GKE

Следующий фрагмент должен присутствовать в поле args yaml-файла развертывания:

export LD_LIBRARY_PATH=/usr/local/nvidia/lib64:$LD_LIBRARY_PATH
export PATH=$PATH:/usr/local/nvidia/bin:/usr/local/nvidia/lib64
/sbin/ldconfig

Например, посмотрите на следующий фрагмент из examples/deployments/GKE/vllm/disagg.yaml

metadata:
name: vllm-disagg
namespace: dynamo-system
spec:
services:
Frontend:
image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:0.6.0
VllmDecodeWorker:
​​ resources:
limits:
gpu: "3"
image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:0.6.0
args:
- |
export LD_LIBRARY_PATH=/usr/local/nvidia/lib64:$LD_LIBRARY_PATH
export PATH=$PATH:/usr/local/nvidia/bin:/usr/local/nvidia/lib64
/sbin/ldconfig
python3 -m dynamo.vllm --model Qwen/Qwen3-0.6B

Разверните модель

cd dynamo/examples/deployments/GKE/vllm

kubectl apply -f disagg_gke.yaml -n ${NAMESPACE}

Ожидаемый вывод после успешного развертывания

kubectl get pods
NAME READY STATUS RESTARTS AGE
dynamo-platform-dynamo-operator-controller-manager-c665684ssqkx 2/2 Running 0 65m
dynamo-platform-etcd-0 1/1 Running 0 65m
dynamo-platform-nats-0 2/2 Running 0 65m
vllm-disagg-frontend-5954ddc4dd-4w2cb 1/1 Running 0 11m
vllm-disagg-vllmdecodeworker-77844cfcff-ddn4v 1/1 Running 0 11m
vllm-disagg-vllmprefillworker-55d5b74b4f-zrskh 1/1 Running 0 11m

Проверьте развертывание

export DEPLOYMENT_NAME=vllm-disagg

# Find the frontend pod
export FRONTEND_POD=$(kubectl get pods -n ${NAMESPACE} | grep "${DEPLOYMENT_NAME}-frontend" | sort -k1 | tail -n1 | awk '{print $1}')

# Forward the pod's port to localhost
kubectl port-forward deployment/vllm-disagg-frontend 8000:8000 -n ${NAMESPACE}

# disagg
curl localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen3-0.6B",
"messages": [
{
"role": "user",
"content": "In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden."
}
],
"stream":false,
"max_tokens": 30
}'

Ответ

{"id":"chatcmpl-bd0670d9-0342-4eea-97c1-99b69f1f931f","choices":[{"index":0,"message":{"content":"Okay, here's a detailed character background for your intrepid explorer, tailored to fit the premise of Aeloria, with a focus on a","refusal":null,"tool_calls":null,"role":"assistant","function_call":null,"audio":null},"finish_reason":"stop","logprobs":null}],"created":1756336263,"model":"Qwen/Qwen3-0.6B","service_tier":null,"system_fingerprint":null,"object":"chat.completion","usage":{"prompt_tokens":190,"completion_tokens":29,"total_tokens":219,"prompt_tokens_details":null,"completion_tokens_details":null}}