In diesem Dokument finden Sie eine detaillierte Anleitung zum Bereitstellen von Open-Weight-Modellen von Mistral AI in GDC-Umgebungen (Google Distributed Cloud) mit Air Gap. Dabei wird die Verwendung von vLLM für die Bereitstellung mit hohem Durchsatz sowie die Nutzung der Funktionen der GDC-Plattform, einschließlich Kubernetes, Harbor und GPU-Ressourcen, behandelt. Wählen Sie im Abschnitt „Modell“ das Modell und die GPU-Option aus. Alle anderen Schritte sind für alle Modelle gleich.
Unterstützte Modelle
| Modell | Hugging Face-Repository | Parameter | Lizenz | GPU-Optionen |
|---|---|---|---|---|
| Mistral 7B Instruct | mistralai/Mistral-7B-Instruct-v0.2 |
7,2 Mrd. (dicht) | Apache 2.0 | 1 x beliebige GPU |
| Mistral NeMo 12B Instruct | mistralai/Mistral-Nemo-Instruct-2407 |
12 Mrd. (dicht) | Apache 2.0 | 1 x beliebige GPU |
| Mistral Small 3.2 24B Instruct | mistralai/Mistral-Small-3.2-24B-Instruct-2506 |
24B (dicht, mit Vision-Encoder) | Apache 2.0 | 1 x NVIDIA A100 80 GB 1 x NVIDIA H100 94 GB 1 x NVIDIA H200 141 GB oder B300 288 GB |
| Ministral 8B Instruct | mistralai/Ministral-8B-Instruct-2410 |
8B (dicht) | Mistral AI Research License (nur für Forschungszwecke und nicht kommerzielle Nutzung) | 1 x beliebige GPU |
| Mixtral 8x7B Instruct | mistralai/Mixtral-8x7B-Instruct-v0.1 |
46,7 Mrd.insgesamt / 12,9 Mrd.aktiv (Mixture of Experts, 8x7B) | Apache 2.0 | 2 x NVIDIA A100 80 GB 2 x NVIDIA H100 94 GB 1 x NVIDIA A100 80 GB oder H100 94 GB mit --quantization=fp81 x NVIDIA H200 141 GB oder B300 288 GB |
| Magistral Small 1.2 24B | mistralai/Magistral-Small-2509 |
24B (Dense, Reasoning, mit Vision-Encoder) | Apache 2.0 | 1 x NVIDIA A100 80 GB 1 x NVIDIA H100 94 GB 1 x NVIDIA H200 141 GB oder B300 288 GB |
Architektur
Die Lösung umfasst die Bereitstellung eines containerisierten Bereitstellungs-Back-Ends (vLLM) als Deployment in einem Standardcluster. Modellgewichtungen werden auf nichtflüchtigen Volumes gespeichert, die aus lokal heruntergeladenen Dateien gefüllt und mit einem Loader-Pod hochgeladen werden. Ein Kubernetes-Service vom Typ LoadBalancer stellt die Backend-API bereit und NetworkPolicy- / ProjectNetworkPolicy-Objekte sichern den Zugriff darauf.
Hinweis
Führen Sie die Referenzimplementierung für Open-Weight-Modelle mit vLLM auf der Workstation aus und achten Sie darauf, dass Sie Zugriff auf das Verzeichnis ${HOME}/gdcag-solutions haben.
Identity and Access Management
Prüfen Sie, ob die erforderlichen IAM-Konten, -Rollen und -Berechtigungen richtig konfiguriert sind.
GDC-Nutzerrollen für die Organisation:
- Optional: Standard-Cluster-Administrator (Cluster über die Console ansehen)
GDC-Nutzerrollen im Projekt:
- Standard-Cluster-Administrator (
standard-cluster-admin)
GDC-Nutzerrolle für den Standardcluster:
StandardClusterRoleBindingfür dieStandardClusterRolecluster-admin(erstellt von einem Projekt-IAM-Administrator, siehe Abschnitt Identity and Access Management der Referenzimplementierung)
Workstation
Führen Sie alle Befehle in diesem Leitfaden auf einer Workstation mit den erforderlichen Tools und der erforderlichen Verbindung zur Umgebung und zum Internet aus, sofern in einem Schritt nichts anderes angegeben ist.
Die Umgebungskonfiguration ist mehrschichtig:
${HOME}/gdcag-solutions/env.shlädt die Plattform- und Registry-Einstellungen.${HOME}/gdcag-solutions/open-weight-models/vllm/env.shfügt die vLLM-Einstellungen hinzu.In diesem Nutzerhandbuch werden
env.d/model.sh(das Modell) undenv.d/accelerator.sh(die GPU-Option und die Laufzeiteinstellungen) hinzugefügt, die Sie im Abschnitt „Modell“ schreiben, sowieenv.d/model-common.sh(die daraus abgeleiteten Werte).
Erstellen Sie die Verzeichnisstruktur für das Nutzerhandbuch:
mkdir -p ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.dErstellen Sie die Konfigurationsdatei für die allgemeine Modellumgebung. Jeder Pfad und Ressourcenname wird von
GDCS_HF_MODELabgeleitet, sodass er für alle Modelle gleich ist:cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/model-common.sh && echo "Successfully created." || echo "Failed to create!" # Model (derived from env.d/model.sh) export GDCS_HF_DOWNLOAD_PATH="${GDCS_USER_GUIDE_HOME}/hf-models" export GDCS_HF_MODEL_LOWERCASE="${GDCS_HF_MODEL,,}" export GDCS_HF_MODEL_DOWNLOAD_DIR="${GDCS_HF_DOWNLOAD_PATH}/${GDCS_HF_MODEL_LOWERCASE}" export GDCS_HF_PV_MOUNT_PATH="/mnt/hf-model" GDCS_HF_MODEL_KUBERNETES="${GDCS_HF_MODEL_LOWERCASE//\//-}" export GDCS_HF_MODEL_KUBERNETES="${GDCS_HF_MODEL_KUBERNETES//./-}" # Workload export GDCS_WORKLOAD_NAMESPACE="vllm-mistral" export GDCS_WORKLOAD_NAME="${GDCS_HF_MODEL_KUBERNETES}" export GDCS_MODEL_LOADER_POD_NAME="loader-${GDCS_HF_MODEL_KUBERNETES}" EOFErstellen Sie die Loader-Datei für die Nutzerhandbuch-Umgebung:
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.sh && echo "Successfully created." || echo "Failed to create!" source "${HOME}/gdcag-solutions/open-weight-models/vllm/env.sh" export GDCS_USER_GUIDE_HOME="${HOME}/gdcag-solutions/open-weight-models/vllm/mistral" echo "GDCS_USER_GUIDE_HOME=${GDCS_USER_GUIDE_HOME}" # Sourced in dependency order: the model selection, the accelerator and runtime settings, then the values derived from them source "${GDCS_USER_GUIDE_HOME}/env.d/model.sh" source "${GDCS_USER_GUIDE_HOME}/env.d/accelerator.sh" source "${GDCS_USER_GUIDE_HOME}/env.d/model-common.sh" echo "GDCS_HF_MODEL=${GDCS_HF_MODEL} (${GDCS_WORKLOAD_ACCELERATOR_COUNT} x ${GDCS_WORKLOAD_ACCELERATOR_TYPE:-unset})" EOF
Modell
Wählen Sie das Modell und die GPU-Option aus, die den GPU-Knoten Ihres Standardclusters entsprechen. GDC mit Air Gap bietet die folgenden GPUs (siehe Maschinentypen für Clusterknoten). Der Ressourcentyp des Beschleunigers ist der Name, unter dem die Knoten die GPU für Kubernetes bereitstellen.
| GPU | Arbeitsspeicher | Maschinentypen | Beschleuniger-Ressourcentyp |
|---|---|---|---|
| NVIDIA A100 | 40 GB | a2-highgpu-1g-gdc |
nvidia.com/gpu-pod-NVIDIA_A100_PCIE_40GB |
| NVIDIA A100 | 80 GB | a2-ultragpu-1g-gdc, a2-ultragpu-2g-gdc |
nvidia.com/gpu-pod-NVIDIA_A100_80GB_PCIE |
| NVIDIA H100 | 94 GB | a3-highgpu-1g-gdc (Vorabversion), a3-highgpu-2g-gdc (Vorabversion), a3-highgpu-4g-gdc |
nvidia.com/gpu-pod-NVIDIA_H100_NVL |
| NVIDIA H200 | 141 GB | a3-ultragpu-8g-gdc |
nvidia.com/gpu-pod-NVIDIA_H200 |
| NVIDIA B300 | 288 GB | a4-ultragpu-8g-gdc |
nvidia.com/gpu-pod-NVIDIA_B300_SXM6_AC |
Auf jedem Tab werden die Modellfakten, der Befehl zum Schreiben der Modellumgebungsdatei env.d/model.sh und verschachtelte Tabs aufgeführt, die die Beschleunigerumgebungsdatei env.d/accelerator.sh für die ausgewählte GPU-Option mit vorausgefüllten Ressourcentypen und vLLM-Einstellungen schreiben. Wenn Sie später das Modell oder die GPU-Optionen ändern möchten, schreiben Sie andere Umgebungsdateien, rufen Sie die Umgebung noch einmal auf und wiederholen Sie den Abschnitt „Implementierung“. Die Arbeitslasten mehrerer Modelle können im selben Namespace nebeneinander ausgeführt werden, da jeder Ressourcenname vom Modellnamen abgeleitet wird.
Erstellen Sie die Modell- und Beschleuniger-Umgebungsdateien für das Modell und die GPU-Option, die Sie bereitstellen möchten.
Mistral 7B Instruct
Attribut Wert Hugging Face-Repository mistralai/Mistral-7B-Instruct-v0.2Parameter 7,2 Mrd. (dicht) Lizenz Apache 2.0 Von vLLM verwendete Gewichtungen Hugging Face-Format ( model-*.safetensors), ca.14,5 GBKontextlänge 32.000 Tokens; dieser Leitfaden dient --max-model-len 32768Erstellen Sie die Modellumgebungsdatei:
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/model.sh && echo "Successfully created." || echo "Failed to create!" # Model: Mistral 7B Instruct export GDCS_HF_MODEL="mistralai/Mistral-7B-Instruct-v0.2" export GDCS_HF_MODEL_REVISION="main" # Hugging Face branch, tag, or commit to download export GDCS_HF_DOWNLOAD_EXCLUDE="consolidated* *.bin" EOFErstellen Sie die Umgebungsdatei für den Beschleuniger für Ihre GPU-Option:
NVIDIA A100 40 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 40 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_PCIE_40GB" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="60" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA A100 80 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 80 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_80GB_PCIE" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="60" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H100 94 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H100 94 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H100_NVL" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="60" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H200 141 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H200 141 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H200" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="60" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA B300 288 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA B300 288 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_B300_SXM6_AC" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="60" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFMistral NeMo 12B Instruct
Attribut Wert Hugging Face-Repository mistralai/Mistral-Nemo-Instruct-2407Parameter 12 Mrd. (dicht) Lizenz Apache 2.0 Von vLLM verwendete Gewichtungen Mistral-Format ( consolidated.safetensors,params.json,tekken.json), ca.24,5 GBKontextlänge 128.000 Tokens; dieser Leitfaden dient --max-model-len 32768Erstellen Sie die Modellumgebungsdatei:
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/model.sh && echo "Successfully created." || echo "Failed to create!" # Model: Mistral NeMo 12B Instruct export GDCS_HF_MODEL="mistralai/Mistral-Nemo-Instruct-2407" export GDCS_HF_MODEL_REVISION="main" # Hugging Face branch, tag, or commit to download export GDCS_HF_DOWNLOAD_EXCLUDE="model-*.safetensors *.bin" EOFErstellen Sie die Umgebungsdatei für den Beschleuniger für Ihre GPU-Option:
NVIDIA A100 40 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 40 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_PCIE_40GB" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="180" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA A100 80 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 80 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_80GB_PCIE" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="180" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H100 94 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H100 94 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H100_NVL" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="180" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H200 141 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H200 141 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H200" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="180" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA B300 288 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA B300 288 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_B300_SXM6_AC" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="180" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFMistral Small 3.2 24B Instruct
Attribut Wert Hugging Face-Repository mistralai/Mistral-Small-3.2-24B-Instruct-2506Parameter 24B (dicht, mit Vision-Encoder) Lizenz Apache 2.0 Von vLLM verwendete Gewichtungen Mistral-Format ( consolidated.safetensors,params.json,tekken.json), ca. 48 GBKontextlänge 128.000 Tokens; dieser Leitfaden dient --max-model-len 32768Erstellen Sie die Modellumgebungsdatei:
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/model.sh && echo "Successfully created." || echo "Failed to create!" # Model: Mistral Small 3.2 24B Instruct export GDCS_HF_MODEL="mistralai/Mistral-Small-3.2-24B-Instruct-2506" export GDCS_HF_MODEL_REVISION="main" # Hugging Face branch, tag, or commit to download export GDCS_HF_DOWNLOAD_EXCLUDE="model-*.safetensors *.bin" EOFErstellen Sie die Umgebungsdatei für den Beschleuniger für Ihre GPU-Option:
NVIDIA A100 80 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 80 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_80GB_PCIE" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="300" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H100 94 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H100 94 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H100_NVL" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="300" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H200 141 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H200 141 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H200" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="300" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA B300 288 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA B300 288 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_B300_SXM6_AC" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="300" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFMinistral 8B Instruct
Attribut Wert Hugging Face-Repository mistralai/Ministral-8B-Instruct-2410Parameter 8B (dicht) Lizenz Mistral AI Research License (nur für Forschungszwecke und nicht kommerzielle Nutzung) Von vLLM verwendete Gewichtungen Mistral-Format ( consolidated.safetensors,params.json,tekken.json), ca. 16 GBKontextlänge 128.000 Tokens; dieser Leitfaden dient --max-model-len 32768Erstellen Sie die Modellumgebungsdatei:
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/model.sh && echo "Successfully created." || echo "Failed to create!" # Model: Ministral 8B Instruct export GDCS_HF_MODEL="mistralai/Ministral-8B-Instruct-2410" export GDCS_HF_MODEL_REVISION="main" # Hugging Face branch, tag, or commit to download export GDCS_HF_DOWNLOAD_EXCLUDE="model-*.safetensors *.bin" EOFErstellen Sie die Umgebungsdatei für den Beschleuniger für Ihre GPU-Option:
NVIDIA A100 40 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 40 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_PCIE_40GB" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="120" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA A100 80 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 80 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_80GB_PCIE" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="120" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H100 94 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H100 94 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H100_NVL" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="120" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H200 141 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H200 141 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H200" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="120" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA B300 288 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA B300 288 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_B300_SXM6_AC" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="120" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFMixtral 8x7B Instruct
Attribut Wert Hugging Face-Repository mistralai/Mixtral-8x7B-Instruct-v0.1Parameter 46,7 Mrd.insgesamt / 12,9 Mrd.aktiv (Mixture of Experts, 8x7B) Lizenz Apache 2.0 Von vLLM verwendete Gewichtungen Hugging Face-Format ( model-*.safetensors), ca. 93 GB (das Repository enthält auchconsolidated.*.ptPyTorch-Dateien, die ausgeschlossen sind)Kontextlänge 32.000 Tokens; dieser Leitfaden dient --max-model-len 32768Erstellen Sie die Modellumgebungsdatei:
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/model.sh && echo "Successfully created." || echo "Failed to create!" # Model: Mixtral 8x7B Instruct export GDCS_HF_MODEL="mistralai/Mixtral-8x7B-Instruct-v0.1" export GDCS_HF_MODEL_REVISION="main" # Hugging Face branch, tag, or commit to download export GDCS_HF_DOWNLOAD_EXCLUDE="consolidated* *.bin" EOFErstellen Sie die Umgebungsdatei für den Beschleuniger für Ihre GPU-Option:
NVIDIA A100 80 GB (2 GPUs)
Erfordert einen Knoten mit zwei A100-GPUs mit 80 GB (
a2-ultragpu-2g-gdc); vLLM wird mit--tensor-parallel-size 2ausgeführt.cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 80 GB (2 GPUs) export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_80GB_PCIE" export GDCS_WORKLOAD_ACCELERATOR_COUNT="2" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="480" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H100 94 GB (2 GPUs)
Erfordert einen Knoten mit mindestens zwei H100-GPUs (
a3-highgpu-2g-gdcodera3-highgpu-4g-gdc). vLLM wird mit--tensor-parallel-size 2ausgeführt.cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H100 94 GB (2 GPUs) export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H100_NVL" export GDCS_WORKLOAD_ACCELERATOR_COUNT="2" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="480" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA A100 80 GB (FP8)
--quantization=fp8quantisiert die Gewichtungen beim Laden auf FP8 (etwa 47 GB statt 93 GB), was zu einer etwas geringeren Ausgabequalität führt.cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 80 GB (FP8) export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_80GB_PCIE" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="--quantization=fp8" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="480" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H100 94 GB (FP8)
--quantization=fp8quantisiert die Gewichtungen beim Laden auf FP8 (etwa 47 GB statt 93 GB), was zu einer etwas geringeren Ausgabequalität führt.cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H100 94 GB (FP8) export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H100_NVL" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="--quantization=fp8" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="480" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA H200 141 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H200 141 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H200" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="480" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFNVIDIA B300 288 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA B300 288 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_B300_SXM6_AC" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="32768" export GDCS_VLLM_EXTRA_ARGS="" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="480" export GDCS_VLLM_TEST_MAX_TOKENS="128" EOFMagistral Small 1.2 24B
Attribut Wert Hugging Face-Repository mistralai/Magistral-Small-2509Parameter 24B (Dense, Reasoning, mit Vision-Encoder) Lizenz Apache 2.0 Von vLLM verwendete Gewichtungen Mistral-Format ( consolidated.safetensors,params.json,tekken.json), ca. 48 GBKontextlänge 128.000 Tokens (40.000 von Mistral empfohlen); in diesem Leitfaden wird --max-model-len 40960verwendetErstellen Sie die Modellumgebungsdatei:
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/model.sh && echo "Successfully created." || echo "Failed to create!" # Model: Magistral Small 1.2 24B export GDCS_HF_MODEL="mistralai/Magistral-Small-2509" export GDCS_HF_MODEL_REVISION="main" # Hugging Face branch, tag, or commit to download export GDCS_HF_DOWNLOAD_EXCLUDE="model-*.safetensors *.bin" EOFErstellen Sie die Umgebungsdatei für den Beschleuniger für Ihre GPU-Option:
NVIDIA A100 80 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA A100 80 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_A100_80GB_PCIE" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="40960" export GDCS_VLLM_EXTRA_ARGS="--reasoning-parser=mistral" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="300" export GDCS_VLLM_TEST_MAX_TOKENS="1024" EOFNVIDIA H100 94 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H100 94 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H100_NVL" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="40960" export GDCS_VLLM_EXTRA_ARGS="--reasoning-parser=mistral" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="300" export GDCS_VLLM_TEST_MAX_TOKENS="1024" EOFNVIDIA H200 141 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA H200 141 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_H200" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="40960" export GDCS_VLLM_EXTRA_ARGS="--reasoning-parser=mistral" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="300" export GDCS_VLLM_TEST_MAX_TOKENS="1024" EOFNVIDIA B300 288 GB
cat << 'EOF' > ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.d/accelerator.sh && echo "Successfully created." || echo "Failed to create!" # Accelerator: NVIDIA B300 288 GB export GDCS_WORKLOAD_ACCELERATOR_TYPE="nvidia.com/gpu-pod-NVIDIA_B300_SXM6_AC" export GDCS_WORKLOAD_ACCELERATOR_COUNT="1" # vLLM export GDCS_VLLM_MAX_MODEL_LEN="40960" export GDCS_VLLM_EXTRA_ARGS="--reasoning-parser=mistral" export GDCS_VLLM_STARTUP_FAILURE_THRESHOLD="300" export GDCS_VLLM_TEST_MAX_TOKENS="1024" EOFRufen Sie die Umgebungsdatei auf:
source ${HOME}/gdcag-solutions/open-weight-models/vllm/mistral/env.shDie Ausgabe sieht etwa so aus:
GDCS_ROOT_HOME=HOME_DIRECTORY_PATH/gdcag-solutions GDCS_IMPLEMENTATION_HOME=HOME_DIRECTORY_PATH/gdcag-solutions/open-weight-models/vllm GDCS_USER_GUIDE_HOME=HOME_DIRECTORY_PATH/gdcag-solutions/open-weight-models/vllm/mistral GDCS_HF_MODEL=HUGGING_FACE_REPOSITORY (ACCELERATOR_COUNT x ACCELERATOR_RESOURCE_TYPE)
Cluster
Konfigurieren Sie
gdcloud:gdcloud config set core/account "default-user" gdcloud config set core/organization_console_url "${GDC_ZONAL_CONSOLE_URL}" gdcloud config set core/project "${GDC_PROJECT}" gdcloud config set core/zone "${GDC_ZONE}"Authentifizieren Sie sich bei der GDC-Umgebung:
gdcloud auth loginClusteranmeldedaten abrufen:
gdcloud clusters get-credentials "${GDC_STANDARD_CLUSTER_NAME}" \ --project="${GDC_PROJECT}" \ --standard \ --zone="${GDC_ZONE}"Prüfen Sie die Verbindung zum Cluster:
kubectl get nodes -L node.cluster.private.gdc.goog/machine-classPrüfen Sie, ob der Beschleuniger-Ressourcentyp der Beschleuniger-Umgebungsdatei im Cluster verfügbar ist. Der Befehl listet die von den Knoten bereitgestellten Beschleuniger-Ressourcentypen (der Name hängt vom installierten GPU-Modell ab; bei Clustern ohne GPU-Knoten ist er leer) und den konfigurierten Wert auf:
kubectl get nodes --output=json | jq -r '[.items[].status.allocatable | keys[] | select(startswith("nvidia.com/"))] | unique[]' echo "GDCS_WORKLOAD_ACCELERATOR_TYPE=${GDCS_WORKLOAD_ACCELERATOR_TYPE}"
Implementierung
Namespace
Erstellen Sie den Namespace:
kubectl create namespace "${GDCS_WORKLOAD_NAMESPACE}" \ --dry-run=client \ --output=yaml | kubectl apply -f -Fügen Sie die
imagePullSecrethinzu:kubectl create secret docker-registry "${GDCS_HARBOR_K8S_PULL_SECRET}" \ --dry-run=client \ --from-file=.dockerconfigjson=${GDCS_HARBOR_K8S_DOCKER_CONFIG}/config.json \ --namespace="${GDCS_WORKLOAD_NAMESPACE}" \ --output=yaml | kubectl apply -f -
Modellgewichtungen
Laden Sie die Modellgewichtungen herunter (nur die Dateien, die vLLM für das ausgewählte Modell benötigt,
GDCS_HF_DOWNLOAD_EXCLUDEüberspringt den Rest) und entfernen Sie das Verzeichnis.cache:EXCLUDE_ARGS=() if [[ -n "${GDCS_HF_DOWNLOAD_EXCLUDE:-}" ]]; then read -r -a EXCLUDE_PATTERNS <<< "${GDCS_HF_DOWNLOAD_EXCLUDE}" EXCLUDE_ARGS=(--exclude "${EXCLUDE_PATTERNS[@]}") fi hf download "${GDCS_HF_MODEL}" --revision "${GDCS_HF_MODEL_REVISION}" --local-dir "${GDCS_HF_MODEL_DOWNLOAD_DIR}" "${EXCLUDE_ARGS[@]}" && \ rm -rf "${GDCS_HF_MODEL_DOWNLOAD_DIR}/.cache"Berechnen Sie die erforderliche
PersistentVolumeClaim-Größe aus den heruntergeladenen Modellgewichtungen mit 25% Overhead (aufgerundet auf das nächste ganze GiB):MODEL_KIB=$(du -sk "${GDCS_HF_MODEL_DOWNLOAD_DIR}" | awk '{print $1}') export GDCS_MODEL_PVC_SIZE="$(( (MODEL_KIB * 125 / 100 + 1048575) / 1048576 ))Gi" echo "GDCS_MODEL_PVC_SIZE=${GDCS_MODEL_PVC_SIZE}"Erstellen Sie das Manifest für den ReadWriteOnce-PersistentVolumeClaim für die Modellgewichtungen:
cat <<EOF > "${GDCS_USER_GUIDE_HOME}/${GDCS_WORKLOAD_NAME}-rwo-pvc.yaml" apiVersion: v1 kind: PersistentVolumeClaim metadata: name: ${GDCS_WORKLOAD_NAME}-rwo spec: accessModes: - ReadWriteOnce resources: requests: storage: ${GDCS_MODEL_PVC_SIZE} storageClassName: standard-rwo volumeMode: Filesystem EOFWenden Sie das Manifest für den PersistentVolumeClaim für die Modellgewichtungen an:
kubectl apply \ --filename="${GDCS_USER_GUIDE_HOME}/${GDCS_WORKLOAD_NAME}-rwo-pvc.yaml" \ --namespace="${GDCS_WORKLOAD_NAMESPACE}"Warten Sie, bis die
PersistentVolumeClaimgebunden ist, und geben Sie die Werte aus, die der Infrastrukturbetreiber benötigt, um die I/O-QoS-Richtlinie (Quality of Service) anzupassen:kubectl wait \ --for=jsonpath='{.status.phase}'=Bound \ "pvc/${GDCS_WORKLOAD_NAME}-rwo" \ --namespace="${GDCS_WORKLOAD_NAMESPACE}" \ --timeout=120s BACKING_PVC=$(kubectl get pvc "${GDCS_WORKLOAD_NAME}-rwo" \ --namespace="${GDCS_WORKLOAD_NAMESPACE}" \ --output=jsonpath='{.spec.volumeName}') echo "BACKING_PVC=${BACKING_PVC} ORG=${GDC_ORG}"Wenn
performance-rwoin Ihrem Cluster nicht verfügbar ist, bitten Sie Ihren Infrastrukturoperator, die Hochleistungs-QoS-Richtlinie (system-performance-<ORG>-admin, 30 IOPS pro GiB mit einem Mindestwert von 6.148 IOPS) auf das Volume anzuwenden, das denPersistentVolumeClaimunterstützt. Geben Sie die Werte fürBACKING_PVCundORGan, die im vorherigen Schritt ausgegeben wurden. Der Infrastrukturbetreiber wendet die Richtlinie wie in FILE-R0097 beschrieben an. Sie wird auf das Live-Volume angewendet, sodass Sie mit den nächsten Schritten fortfahren können.Erstellen Sie das Manifest für den Modell-Loader-Pod:
cat <<EOF > "${GDCS_USER_GUIDE_HOME}/${GDCS_MODEL_LOADER_POD_NAME}-pod.yaml" apiVersion: v1 kind: Pod metadata: name: ${GDCS_MODEL_LOADER_POD_NAME} spec: containers: - name: uploader image: ${GDCS_HARBOR_PROJECT_URI}/library/busybox:${GDCS_BUSYBOX_IMAGE_TAG} command: ["sleep", "infinity"] volumeMounts: - name: model-data mountPath: ${GDCS_HF_PV_MOUNT_PATH} imagePullSecrets: - name: ${GDCS_HARBOR_K8S_PULL_SECRET} volumes: - name: model-data persistentVolumeClaim: claimName: ${GDCS_WORKLOAD_NAME}-rwo EOFWenden Sie das Manifest für den Modell-Loader-Pod an:
kubectl apply \ --filename="${GDCS_USER_GUIDE_HOME}/${GDCS_MODEL_LOADER_POD_NAME}-pod.yaml" \ --namespace="${GDCS_WORKLOAD_NAMESPACE}"Warten Sie, bis der Pod für das Laden des Modells ausgeführt wird:
watch --color --interval 5 --no-title \ "kubectl get pod/${GDCS_MODEL_LOADER_POD_NAME} \ --namespace=${GDCS_WORKLOAD_NAMESPACE} | GREP_COLORS='mt=01;92' grep -E --color=always -e '^' -e 'Running'"Laden Sie die Modellgewichtungen in
PersistentVolumehoch. Das Script überspringt Dateien, die bereits mit derselben Größe vorhanden sind, sodass es noch einmal ausgeführt werden kann:export LOCAL_MODEL_DIR="${GDCS_HF_MODEL_DOWNLOAD_DIR}" export REMOTE_MODEL_DIR="${GDCS_HF_PV_MOUNT_PATH}/${GDCS_HF_MODEL_LOWERCASE}" export REMOTE_MOUNT_DIR="${GDCS_HF_PV_MOUNT_PATH}" ${GDCS_IMPLEMENTATION_HOME}/model_weight_upload.shLöschen Sie den Pod für das Laden des Modells:
kubectl delete pod/${GDCS_MODEL_LOADER_POD_NAME} \ --namespace="${GDCS_WORKLOAD_NAMESPACE}"
Inferenzserver
Erstellen Sie das Manifest für das vLLM-Deployment. Die ConfigMap enthält die modellspezifischen vLLM-Einstellungen aus der Umgebung, sodass das Manifest für jedes Modell und jede GPU-Option gleich ist:
cat <<EOF > "${GDCS_USER_GUIDE_HOME}/${GDCS_WORKLOAD_NAME}-deployment.yaml" apiVersion: v1 kind: ConfigMap metadata: name: ${GDCS_WORKLOAD_NAME} data: MAX_MODEL_LEN: "${GDCS_VLLM_MAX_MODEL_LEN}" MODEL: "${GDCS_HF_PV_MOUNT_PATH}/${GDCS_HF_MODEL_LOWERCASE}" PORT: "8000" TENSOR_PARALLEL_SIZE: "${GDCS_WORKLOAD_ACCELERATOR_COUNT}" VLLM_EXTRA_ARGS: "${GDCS_VLLM_EXTRA_ARGS}" --- apiVersion: apps/v1 kind: Deployment metadata: name: ${GDCS_WORKLOAD_NAME} labels: app: ${GDCS_WORKLOAD_NAME} spec: replicas: 1 selector: matchLabels: app: ${GDCS_WORKLOAD_NAME} strategy: type: Recreate template: metadata: labels: app: ${GDCS_WORKLOAD_NAME} spec: containers: - command: - /bin/sh - -c args: - exec vllm serve "\$MODEL" --port="\$PORT" --tensor-parallel-size="\$TENSOR_PARALLEL_SIZE" --max-model-len="\$MAX_MODEL_LEN" \$VLLM_EXTRA_ARGS envFrom: - configMapRef: name: ${GDCS_WORKLOAD_NAME} image: ${GDCS_HARBOR_PROJECT_URI}/vllm/vllm-openai:${GDCS_VLLM_IMAGE_TAG}-fips livenessProbe: failureThreshold: 3 httpGet: path: /health port: 8000 periodSeconds: 20 timeoutSeconds: 5 name: vllm ports: - containerPort: 8000 readinessProbe: failureThreshold: 3 httpGet: path: /health port: 8000 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 resources: limits: ${GDCS_WORKLOAD_ACCELERATOR_TYPE}: "${GDCS_WORKLOAD_ACCELERATOR_COUNT}" requests: ${GDCS_WORKLOAD_ACCELERATOR_TYPE}: "${GDCS_WORKLOAD_ACCELERATOR_COUNT}" startupProbe: httpGet: path: /health port: 8000 failureThreshold: ${GDCS_VLLM_STARTUP_FAILURE_THRESHOLD} periodSeconds: 10 timeoutSeconds: 5 volumeMounts: - name: model-weights mountPath: ${GDCS_HF_PV_MOUNT_PATH} - name: shm mountPath: /dev/shm securityContext: seLinuxOptions: type: spc_t imagePullSecrets: - name: ${GDCS_HARBOR_K8S_PULL_SECRET} volumes: - name: model-weights persistentVolumeClaim: claimName: ${GDCS_WORKLOAD_NAME}-rwo - name: shm emptyDir: medium: Memory sizeLimit: "8Gi" --- apiVersion: v1 kind: Service metadata: name: ${GDCS_WORKLOAD_NAME} spec: ports: - name: vllm-http port: 80 protocol: TCP targetPort: 8000 selector: app: ${GDCS_WORKLOAD_NAME} type: LoadBalancer EOFWenden Sie das Manifest für das vLLM-Deployment an:
kubectl apply \ --filename="${GDCS_USER_GUIDE_HOME}/${GDCS_WORKLOAD_NAME}-deployment.yaml" \ --namespace="${GDCS_WORKLOAD_NAMESPACE}"Erstellen Sie das Manifest für das vLLM-
NetworkPolicy:cat << EOF > "${GDCS_USER_GUIDE_HOME}/vllm-networkpolicy.yaml" && echo "Successfully created." || echo "Failed to create!" apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-vllm-ingress namespace: ${GDCS_WORKLOAD_NAMESPACE} spec: ingress: - from: - ipBlock: cidr: 0.0.0.0/0 - namespaceSelector: {} ports: - port: 8000 protocol: TCP podSelector: {} policyTypes: - Ingress EOFWenden Sie das Manifest für den vLLM-
NetworkPolicyan:kubectl apply \ --filename="${GDCS_USER_GUIDE_HOME}/vllm-networkpolicy.yaml"
Warten Sie, bis der Pod ausgeführt wird:
watch --color --interval 5 --no-title \ "kubectl get pods --selector=app=${GDCS_WORKLOAD_NAME} \ --namespace=${GDCS_WORKLOAD_NAMESPACE} | GREP_COLORS='mt=01;92' grep -E --color=always -e '^' -e 'Running'"Warten Sie, bis die Bereitstellung bereit ist:
watch --color --interval 5 --no-title \ "kubectl get deployment/${GDCS_WORKLOAD_NAME} \ --namespace=${GDCS_WORKLOAD_NAMESPACE} | GREP_COLORS='mt=01;92' grep -E --color=always -e '^' -e '1/1 1 1'"Optional: Streamen Sie die Containerlogs, um den Startfortschritt zu überwachen:
kubectl logs deployment/${GDCS_WORKLOAD_NAME} \ --follow \ --namespace="${GDCS_WORKLOAD_NAMESPACE}"
Validierung
Rufen Sie die LoadBalancer-IP-Adresse für vLLM ab:
export VLLM_LB_IP=$(kubectl get service/${GDCS_WORKLOAD_NAME} --namespace="${GDCS_WORKLOAD_NAMESPACE}" --output=jsonpath='{.status.loadBalancer.ingress[*].ip}') echo "VLLM_LB_IP=${VLLM_LB_IP}"Senden Sie eine Testanfrage an vLLM. Der Wert für
max_tokensistGDCS_VLLM_TEST_MAX_TOKENSvonenv.d/accelerator.sh. Reasoning-Modelle benötigen ein größeres Budget, da die Reasoning-Phase Ausgabetokens verbraucht:curl http://${VLLM_LB_IP}/v1/models curl http://${VLLM_LB_IP}/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "'${GDCS_HF_PV_MOUNT_PATH}/${GDCS_HF_MODEL_LOWERCASE}'", "messages": [ {"role": "user", "content": "Explain Google Distributed Cloud air-gapped briefly."} ], "max_tokens": '${GDCS_VLLM_TEST_MAX_TOKENS}' }'Wenn die LoadBalancer-IP-Adresse von der Workstation aus nicht erreichbar ist, z. B. weil sie noch von keinem
ProjectNetworkPolicyzugelassen wird, senden Sie die Anfragen über die Portweiterleitung:kubectl port-forward service/${GDCS_WORKLOAD_NAME} \ --namespace="${GDCS_WORKLOAD_NAMESPACE}" 8000:80 & PF_PID=$! sleep 1 curl http://127.0.0.1:8000/v1/models kill ${PF_PID}