truss deployment example
Browse files- truss/config_nvfp4_4gpu.yaml +73 -0
- truss/data/start_server.sh +1 -1
truss/config_nvfp4_4gpu.yaml
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model_name: glm-5.2-vision-nvfp4-4gpu
|
| 2 |
+
model_metadata:
|
| 3 |
+
example_model_input:
|
| 4 |
+
model: glm-5.2-vision-nvfp4-4gpu
|
| 5 |
+
messages:
|
| 6 |
+
- role: user
|
| 7 |
+
content:
|
| 8 |
+
- type: image_url
|
| 9 |
+
image_url:
|
| 10 |
+
url: "https://ultralytics.com/images/bus.jpg"
|
| 11 |
+
- type: text
|
| 12 |
+
text: "Describe this image in detail."
|
| 13 |
+
max_tokens: 512
|
| 14 |
+
temperature: 1.0
|
| 15 |
+
top_p: 0.95
|
| 16 |
+
tags:
|
| 17 |
+
- openai-compatible
|
| 18 |
+
|
| 19 |
+
# Deploy GLM-5.2-Vision (NVFP4 build) on FOUR B200s instead of eight.
|
| 20 |
+
# truss push --config config_nvfp4_4gpu.yaml --remote <your-remote>
|
| 21 |
+
#
|
| 22 |
+
# 465GB of NVFP4 weights across 4x183GB leaves ~11GB/GPU of headroom, so this runs
|
| 23 |
+
# at mem-fraction 0.90 and a 256k context rather than the full 1M. Measured on
|
| 24 |
+
# 4xB200: ~172GB/GPU resident, KV budget ~973k tokens — comfortably above 256k.
|
| 25 |
+
#
|
| 26 |
+
# Unlike the internal deployments this was derived from, there is NO checkpoint
|
| 27 |
+
# assembly here: the model_cache repo below is already the fully assembled
|
| 28 |
+
# checkpoint (GLM-5.2 text + MoonViT vision tower + trained projector + processor
|
| 29 |
+
# remote code), so start_server.sh only installs the plugin and launches SGLang.
|
| 30 |
+
#
|
| 31 |
+
# To deploy: truss push --remote <your-remote>
|
| 32 |
+
base_image:
|
| 33 |
+
# SGLang 0.5.13, CUDA 13, Blackwell (sm_100). Ships the DSA sparse-attention and
|
| 34 |
+
# trtllm-gen fp4-MoE kernels this checkpoint needs.
|
| 35 |
+
image: lmsysorg/sglang:v0.5.13-cu130
|
| 36 |
+
|
| 37 |
+
docker_server:
|
| 38 |
+
# data/ -> /app/data ; packages/ -> /packages
|
| 39 |
+
start_command: bash /app/data/start_server.sh
|
| 40 |
+
readiness_endpoint: /health
|
| 41 |
+
liveness_endpoint: /health
|
| 42 |
+
predict_endpoint: /v1/chat/completions
|
| 43 |
+
server_port: 8000
|
| 44 |
+
|
| 45 |
+
model_cache:
|
| 46 |
+
# The whole model, one repo — no assembly at serve time.
|
| 47 |
+
- repo_id: baseten/GLM-5.2-Vision-NVFP4
|
| 48 |
+
revision: main
|
| 49 |
+
volume_folder: glm5v_nvfp4
|
| 50 |
+
use_volume: true
|
| 51 |
+
|
| 52 |
+
environment_variables:
|
| 53 |
+
# NVFP4 is Blackwell-only and needs the modelopt_fp4 path plus two disable flags
|
| 54 |
+
# (see start_server.sh). GLM5V_CKPT must match volume_folder above.
|
| 55 |
+
GLM5V_CKPT: /app/model_cache/glm5v_nvfp4
|
| 56 |
+
GLM5V_QUANTIZATION: modelopt_fp4
|
| 57 |
+
GLM5V_TP_SIZE: "4"
|
| 58 |
+
GLM5V_MAX_MODEL_LEN: "262144"
|
| 59 |
+
GLM5V_MEM_FRACTION: "0.90"
|
| 60 |
+
|
| 61 |
+
secrets:
|
| 62 |
+
hf_access_token: null
|
| 63 |
+
|
| 64 |
+
resources:
|
| 65 |
+
accelerator: B200:4
|
| 66 |
+
use_gpu: true
|
| 67 |
+
|
| 68 |
+
runtime:
|
| 69 |
+
predict_concurrency: 32
|
| 70 |
+
health_checks:
|
| 71 |
+
# First boot pays the weight transfer + SGLang load + cuda-graph capture.
|
| 72 |
+
restart_threshold_seconds: 3000
|
| 73 |
+
stop_traffic_threshold_seconds: 120
|
truss/data/start_server.sh
CHANGED
|
@@ -68,7 +68,7 @@ fi
|
|
| 68 |
exec python3 -m sglang.launch_server \
|
| 69 |
--model-path "$CKPT" \
|
| 70 |
--trust-remote-code \
|
| 71 |
-
--tp-size 8 \
|
| 72 |
$QUANT_ARGS \
|
| 73 |
--attention-backend "${GLM5V_ATTN_BACKEND:-dsa}" \
|
| 74 |
--mm-attention-backend sdpa \
|
|
|
|
| 68 |
exec python3 -m sglang.launch_server \
|
| 69 |
--model-path "$CKPT" \
|
| 70 |
--trust-remote-code \
|
| 71 |
+
--tp-size "${GLM5V_TP_SIZE:-8}" \
|
| 72 |
$QUANT_ARGS \
|
| 73 |
--attention-backend "${GLM5V_ATTN_BACKEND:-dsa}" \
|
| 74 |
--mm-attention-backend sdpa \
|