סקירה כללית
Gemini Enterprise Agent Platform תומך בפריסת GPU מרובה לאירוח מודלים שחורגים מיכולת הזיכרון של צומת GPU יחיד, כמו DeepSeek-V3, DeepSeek-R1 ו-Meta LLama 3.1 405B (גרסה לא מכומתת).
במדריך הזה מוסבר איך להפעיל מודל DeepSeek-V3 באמצעות יחידות עיבוד גרפיות (GPU) מרובות מארחים בפלטפורמת הסוכנים של Gemini Enterprise עם vLLM. ההגדרה בדגמים אחרים דומה. מידע נוסף זמין במאמר בנושא הפעלת vLLM עבור מודלים של שפה טקסטואלית ומולטימודלית.
לפני שמתחילים, חשוב לוודא שאתם מכירים את המושגים הבאים:
- זמינות גרסת ה-GPU לפי אזור
- תמחור של מעבדים גרפיים לפי אזור
- תמחור של Cloud Storage
- התמחור של Gemini Enterprise Agent Platform
אפשר להשתמש במחשבון עלויות כדי ליצור הערכת עלויות בהתאם לשימוש החזוי.
קונטיינרים
כדי לתמוך בפריסות של כמה מארחים, במדריך הזה נעשה שימוש בתמונה של מאגר vLLM שנבנה מראש עם שילוב של Ray מ-Model Garden. Ray מאפשר עיבוד מבוזר שנדרש להרצת מודלים בכמה צמתי GPU.
אם רוצים, אפשר ליצור תמונה משלכם של vLLM עם כמה צמתים. חשוב לשים לב שתמונת הקונטיינר המותאמת אישית צריכה להיות תואמת ל-Gemini Enterprise Agent Platform.
לפני שמתחילים
לפני שמתחילים בפריסת המודל, צריך לוודא שמתקיימים התנאים המוקדמים שמפורטים בקטע הזה.
הגדרת Google Cloud פרויקט
- נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Agent Platform API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Agent Platform API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
במסוף Google Cloud , מפעילים את Cloud Shell.
בחלק התחתון של Google Cloud המסוף יתחיל סשן של Cloud Shell ותופיע הודעה של שורת הפקודה. Cloud Shell היא סביבת מעטפת שבה ה-CLI של Google Cloud מותקן ומוגדרים ערכים לפרויקט הקיים. הסשן יופעל תוך כמה שניות.
בקשת מכסת GPU
כדי לפרוס את DeepSeek-V3, צריך שתי מכונות וירטואליות a3-highgpu-8g עם שמונה יחידות GPU מסוג H100 בכל אחת, כלומר 16 יחידות GPU מסוג H100 בסך הכול. סביר להניח שתצטרכו לבקש הגדלה של מכסת יחידות ה-GPU מסוג H100, כי ערך ברירת המחדל הוא פחות מ-16.
כדי לראות את מכסת ה-GPU של H100, עוברים לדף Quotas & System Limits במסוף Google Cloud .
העלאת המודל
כדי להעלות את המודל שלכם כמשאב
Modelל-Gemini Enterprise Agent Platform, מריצים את הפקודהgcloud ai models uploadבאופן הבא:gcloud ai models upload \ --region=LOCATION \ --project=PROJECT_ID \ --display-name=MODEL_DISPLAY_NAME \ --container-image-uri=us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-vllm-serve:20250312_0916_RC01 \ --container-args='^;^/vllm-workspace/ray_launcher.sh;python;-m;vllm.entrypoints.api_server;--host=0.0.0.0;--port=7080;--model=deepseek-ai/DeepSeek-V3;--tensor-parallel-size=8;--pipeline-parallel-size=2;--gpu-memory-utilization=0.82;--max-model-len=163840;--max-num-seqs=64;--enable-chunked-prefill;--kv-cache-dtype=auto;--trust-remote-code;--disable-log-requests' \ --container-deployment-timeout-seconds=7200 \ --container-ports=7080 \ --container-env-vars=MODEL_ID=deepseek-ai/DeepSeek-V3מחליפים את הפרטים הבאים:
-
LOCATION: האזור שבו אתם משתמשים ב-Gemini Enterprise Agent Platform -
PROJECT_ID: מזהה הפרויקט ב- Google Cloud -
MODEL_DISPLAY_NAME: השם המוצג שרוצים לתת למודל
-
יצירת נקודת קצה ייעודית להסקת מסקנות אונליין
כדי לתמוך בבקשות להשלמת צ'אט, קונטיינר Model Garden דורש נקודת קצה ייעודית. נקודות קצה ייעודיות הן בגרסת טרום-השקה (Preview) ולא תומכות ב-Google Cloud CLI, לכן צריך להשתמש ב-API בארכיטקטורת REST כדי ליצור את נקודת הקצה.
כדי ליצור את נקודת הקצה הייעודית, מריצים את הפקודה הבאה:
PROJECT_ID=PROJECT_ID REGION=LOCATION ENDPOINT="${REGION}-aiplatform.googleapis.com" curl \ -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ https://${ENDPOINT}/v1/projects/${PROJECT_ID}/locations/${REGION}/endpoints \ -d '{ "displayName": "ENDPOINT_DISPLAY_NAME", "dedicatedEndpointEnabled": true }'מחליפים את הפרטים הבאים:
-
ENDPOINT_DISPLAY_NAME: השם המוצג של נקודת הקצה
-
פריסת המודל
מריצים את הפקודה
gcloud ai endpoints listכדי לקבל את מזהה נקודת הקצה של נקודת הקצה להסקת מסקנות אונליין:ENDPOINT_ID=$(gcloud ai endpoints list \ --project=PROJECT_ID \ --region=LOCATION \ --filter=display_name~'ENDPOINT_DISPLAY_NAME' \ --format="value(name)")מריצים את הפקודה
gcloud ai models listכדי לקבל את מזהה המודל:MODEL_ID=$(gcloud ai models list \ --project=PROJECT_ID \ --region=LOCATION \ --filter=display_name~'MODEL_DISPLAY_NAME' \ --format="value(name)")פורסים את המודל בנקודת הקצה באמצעות הפקודה
gcloud ai deploy-model:gcloud alpha ai endpoints deploy-model $ENDPOINT_ID \ --project=PROJECT_ID \ --region=LOCATION \ --model=$MODEL_ID \ --display-name="DEPLOYED_MODEL_NAME" \ --machine-type=a3-highgpu-8g \ --traffic-split=0=100 \ --accelerator=type=nvidia-h100-80gb,count=8 \ --multihost-gpu-node-count=2מחליפים את DEPLOYED_MODEL_NAME בשם של המודל שנפרס. השם יכול להיות זהה לשם המוצג של המודל (MODEL_DISPLAY_NAME).
פריסת מודלים גדולים כמו DeepSeek-V3 יכולה להימשך יותר מהזמן הקצוב לתפוגת פריסה שמוגדר כברירת מחדל. אם פסק הזמן של הפקודה
deploy-modelחלף, תהליך הפריסה ממשיך לפעול ברקע.הפקודה
deploy-modelמחזירה מזהה פעולה שאפשר להשתמש בו כדי לבדוק מתי הפעולה מסתיימת. אפשר לדגום את סטטוס הפעולה עד שהתשובה כוללת את"done": true. כדי לבדוק את הסטטוס, מריצים את הפקודה הבאה:gcloud ai operations describe \ --region=LOCATION \ OPERATION_IDמחליפים את OPERATION_ID במזהה הפעולה שהוחזר מהפקודה הקודמת.
קבלת מסקנות אונליין מהמודל שנפרס
בקטע הזה נסביר איך שולחים בקשת הסקה אונליין לנקודת הקצה הציבורית הייעודית שבה מודל DeepSeek-V3 נפרס.
כדי לקבל את מספר הפרויקט, מריצים את הפקודה
gcloud projects describe:PROJECT_NUMBER=$(gcloud projects describe PROJECT_ID --format="value(projectNumber)")שליחת בקשת חיזוי RAW:
curl \ -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ https://${ENDPOINT_ID}.${REGION}-${PROJECT_NUMBER}.prediction.vertexai.goog/v1/projects/${PROJECT_NUMBER}/locations/${REGION}/endpoints/${ENDPOINT_ID}:rawPredict \ -d '{ "prompt": "Write a short story about a robot.", "stream": false, "max_tokens": 50, "temperature": 0.7 }'שליחת בקשה להשלמת צ'אט:
curl \ -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ https://${ENDPOINT_ID}.${REGION}-${PROJECT_NUMBER}.prediction.vertexai.goog/v1/projects/${PROJECT_NUMBER}/locations/${REGION}/endpoints/${ENDPOINT_ID}/chat/completions \ -d '{"stream":false, "messages":[{"role": "user", "content": "Summer travel plan to Paris"}], "max_tokens": 40,"temperature":0.4,"top_k":10,"top_p":0.95, "n":1}'כדי להפעיל סטרימינג, משנים את הערך של
"stream"מ-falseל-true.
הסרת המשאבים
כדי להימנע מחיובים נוספים על Gemini Enterprise Agent Platform, צריך למחוק את Google Cloud המשאבים שיצרתם במהלך המדריך הזה:
כדי לבטל את הפריסה של המודל מנקודת הקצה ולמחוק את נקודת הקצה, מריצים את הפקודות הבאות:
ENDPOINT_ID=$(gcloud ai endpoints list \ --region=LOCATION \ --filter=display_name=ENDPOINT_DISPLAY_NAME \ --format="value(name)") DEPLOYED_MODEL_ID=$(gcloud ai endpoints describe $ENDPOINT_ID \ --region=LOCATION \ --format="value(deployedModels.id)") gcloud ai endpoints undeploy-model $ENDPOINT_ID \ --region=LOCATION \ --deployed-model-id=$DEPLOYED_MODEL_ID gcloud ai endpoints delete $ENDPOINT_ID \ --region=LOCATION \ --quietכדי למחוק את המודל, מריצים את הפקודות הבאות:
MODEL_ID=$(gcloud ai models list \ --region=LOCATION \ --filter=display_name=DEPLOYED_MODEL_NAME \ --format="value(name)") gcloud ai models delete $MODEL_ID \ --region=LOCATION \ --quiet
המאמרים הבאים
- מידע מקיף על פריסת GPU מרובת-מארחים ב-Gemini Enterprise Agent Platform עם vLLM זמין במאמר vLLM serving for text and multimodal language models.
- כך יוצרים קובץ אימג' של קונטיינר vLLM עם כמה צמתים. חשוב לזכור שקובץ אימג' של הקונטיינר המותאם אישית צריך להיות תואם ל-Gemini Enterprise Agent Platform.