- Documentation
GPU Compute Service
GPU Compute Service
Best Practices
Building models
GLM series models
GPU - Deploying GLM-5.2 model
GLM series models
GPU - Deploying GLM-5.2 model
GPU - Deploying GLM-5.2 model
This topic describes how to deploy the GLM-5.2 model on GPU instances, using two ecs.hpcpni3ln.45xlarge instances as an example.
GLM-5.2-FP8 is the FP8-quantized version of the latest open-source MoE large model. It delivers a 1M context window, boasting approximately 753B total model parameters and around 40B active parameters during inference. This large-scale model is designed for long-context processing, code generation, complex reasoning, and agent scenarios. Its FP8-quantized version further reduces GPU memory usage for inference, making it more suitable for high-performance deployment and local inference scenarios.
- GPU driver: A program used to drive NVIDIA GPUs. In the example provided in this topic, version 535.261.03 is used.
- SGLang framework: a high-performance service framework specifically built for Large Language Models (LLMs) and vision-language models. With the collaborative design of the frontend structured generation language and the backend runtime system, the SGLang framework supports efficient interaction with models and ensures controllability of the generation process. In this topic, v0.5.13 is used for demonstration.
Step 1: Prepare the environment
- Create a GPU Accelerated instance.
- Install the required software and tools.
- Execute the following commands to install and configure Docker.
sudo apt install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://mirrors.ivolces.com/docker/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.ivolces.com/docker/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
- Execute the following commands to install the NVIDIA Container Toolkit.
curl -s https://mirrors.ivolces.com/nvidia_all/ubuntu2204/x86_64/3bf863cc.pub | sudo apt-key add -
cat <<EOF >/etc/apt/sources.list.d/nvidia.list
deb http://mirrors.ivolces.com/nvidia_all/ubuntu2204/x86_64/ /
apt install nvidia-container-toolkit -y
- Execute the following commands to configure Docker so that containers can use the instance's GPU resources.
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
- (Optional) Initialize the local volume.
- If the instance type you choose has local volume provided, we recommend that you execute the following commands to mount the local volume to the directory "/data00" where the model is stored. By doing this, you can improve the model loading speed.
mkfs -t ext4 /dev/nvme0n1
mount -t ext4 /dev/nvme0n1 /data00
tip
- Replace /dev/nvme0n1 with the name of the actual local volume.
- Replace ext4 with the file system you want to use.
Step 2: Deploy and run the model
- Log in to the two purchased GPU instances. Learn more.
- Execute the following command separately on the two instances to install and configure the onion and download the GLM-5.2-FP8 model file.
China (Beijing)
China (Shanghai)
ai-containers-cn-beijing.cr.volces.com/deeplearning/sglang:v0.5.13.post1.iaas.dev.202606172008 \
if ! command -v oniond >/dev/null 2>&1; then
apt install -y ca-certificates curl gnupg gpg
curl -fsSL https://mirrors.ivolces.com/extra-tools/ubuntu/GPG-KEY-system | gpg --dearmor -o /etc/apt/trusted.gpg.d/volc-extra-tools.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/volc-extra-tools.gpg] http://mirrors.ivolces.com/extra-tools/ubuntu noble main" > /etc/apt/sources.list.d/volctools.list
apt install -y onion-ai-data
oniond download model GLM-5.2-FP8 --turbo --dir /data00
ai-containers-cn-shanghai.cr.volces.com/deeplearning/sglang:v0.5.13.post1.iaas.dev.202606172008 \
if ! command -v oniond >/dev/null 2>&1; then
apt install -y ca-certificates curl gnupg gpg
curl -fsSL https://mirrors.ivolces.com/extra-tools/ubuntu/GPG-KEY-system | gpg --dearmor -o /etc/apt/trusted.gpg.d/volc-extra-tools.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/volc-extra-tools.gpg] http://mirrors.ivolces.com/extra-tools/ubuntu noble main" > /etc/apt/sources.list.d/volctools.list
apt install -y onion-ai-data
oniond download model GLM-5.2-FP8 --turbo --dir /data00
tip
You can also execute the oniond list model command to view the list of available models.
- Execute the following commands separately on both GPU instances based on the region of the instance to download the Docker image.
China (Beijing)
China (Shanghai)
docker pull ai-containers-cn-beijing.cr.volces.com/deeplearning/sglang:v0.5.13.post1.iaas.dev.202606172008
docker pull ai-containers-cn-shanghai.cr.volces.com/deeplearning/sglang:v0.5.13.post1.iaas.dev.202606172008
- Execute the following commands separately on both GPU instances based on the region of the instance to start the Docker container.
tip
- Replace /data00 in the command with the actual path where the model is stored.
- Replace <rank0_private_ip> in the command with the private IP address of the Rank 0 node instance.
- Replace <Port> in the command with the port number for model service communication between the two instances. You can specify any port number (for example, 20000).
Rank 0 (primary node)
Rank 1
--ulimit stack=67108864 \
--security-opt seccomp=unconfined \
-v /var/run/nvidia-topologyd/:/var/run/nvidia-topologyd/ \
-e GLOO_SOCKET_IFNAME=eth0 \
-e MODEL_LENGTH=262144 \
-e NCCL_MIN_NCHANNELS=24 \
-e NCCL_IB_QPS_PER_CONNECTION=8 \
-e CUDA_CACHE_MAXSIZE=2147483648 \
-e SGLANG_ENABLE_SPEC_V2=1 \
ai-containers-cn-beijing.cr.volces.com/deeplearning/sglang:v0.5.13.post1.iaas.dev.202606172008 \
--model-path /data00/GLM-5.2-FP8/ \
--served-model-name glm-5.2 \
--trust-remote-code --tp 16 \
--dist-init-addr "<rank0_private_ip>:<Port>" \
--chunked-prefill-size 32768 \
--enable-metrics --enable-cache-report --show-time-cost --reasoning-parser glm45 \
--tool-call-parser glm47 \
--speculative-algorithm EAGLE \
--speculative-num-steps 3 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 4 \
--mem-fraction-static 0.82 \
--enable-metrics-for-all-schedulers
--ulimit stack=67108864 \
--security-opt seccomp=unconfined \
-v /var/run/nvidia-topologyd/:/var/run/nvidia-topologyd/ \
-e GLOO_SOCKET_IFNAME=eth0 \
-e MODEL_LENGTH=262144 \
-e NCCL_MIN_NCHANNELS=24 \
-e NCCL_IB_QPS_PER_CONNECTION=8 \
-e CUDA_CACHE_MAXSIZE=2147483648 \
-e SGLANG_ENABLE_SPEC_V2=1 \
ai-containers-cn-beijing.cr.volces.com/deeplearning/sglang:v0.5.13.post1.iaas.dev.202606172008 \
--model-path /data00/GLM-5.2-FP8/ \
--served-model-name glm-5.2 \
--trust-remote-code --tp 16 \
--dist-init-addr "<rank0_private_ip>:<Port>" \
--chunked-prefill-size 32768 \
--enable-metrics --enable-cache-report --show-time-cost --reasoning-parser glm45 \
--tool-call-parser glm47 \
--speculative-algorithm EAGLE \
--speculative-num-steps 3 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 4 \
--mem-fraction-static 0.82 \
--enable-metrics-for-all-schedulers
--ulimit stack=67108864 \
--security-opt seccomp=unconfined \
-v /var/run/nvidia-topologyd/:/var/run/nvidia-topologyd/ \
-e GLOO_SOCKET_IFNAME=eth0 \
-e MODEL_LENGTH=262144 \
-e NCCL_MIN_NCHANNELS=24 \
-e NCCL_IB_QPS_PER_CONNECTION=8 \
-e CUDA_CACHE_MAXSIZE=2147483648 \
-e SGLANG_ENABLE_SPEC_V2=1 \
ai-containers-cn-shanghai.cr.volces.com/deeplearning/sglang:v0.5.13.post1.iaas.dev.202606172008 \
--model-path /data00/GLM-5.2-FP8/ \
--served-model-name glm-5.2 \
--trust-remote-code --tp 16 \
--dist-init-addr "<rank0_private_ip>:<Port>" \
--chunked-prefill-size 32768 \
--enable-metrics --enable-cache-report --show-time-cost --reasoning-parser glm45 \
--tool-call-parser glm47 \
--speculative-algorithm EAGLE \
--speculative-num-steps 3 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 4 \
--mem-fraction-static 0.82 \
--enable-metrics-for-all-schedulers
--ulimit stack=67108864 \
--security-opt seccomp=unconfined \
-v /var/run/nvidia-topologyd/:/var/run/nvidia-topologyd/ \
-e GLOO_SOCKET_IFNAME=eth0 \
-e MODEL_LENGTH=262144 \
-e NCCL_MIN_NCHANNELS=24 \
-e NCCL_IB_QPS_PER_CONNECTION=8 \
-e CUDA_CACHE_MAXSIZE=2147483648 \
-e SGLANG_ENABLE_SPEC_V2=1 \
ai-containers-cn-shanghai.cr.volces.com/deeplearning/sglang:v0.5.13.post1.iaas.dev.202606172008 \
--model-path /data00/GLM-5.2-FP8/ \
--served-model-name glm-5.2 \
--trust-remote-code --tp 16 \
--dist-init-addr "<rank0_private_ip>:<Port>" \
--chunked-prefill-size 32768 \
--enable-metrics --enable-cache-report --show-time-cost --reasoning-parser glm45 \
--tool-call-parser glm47 \
--speculative-algorithm EAGLE \
--speculative-num-steps 3 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 4 \
--mem-fraction-static 0.82 \
--enable-metrics-for-all-schedulers
- In the example from the previous step, the commands are used to start and deploy the GLM-5.2 model. To deploy and start other models, replace the relevant environment variables and parameter values in the commands according to the parameter descriptions in the following table.
- Execute the following command to enter the Docker container:
tip
Replace <CONTAINER_ID> in the command with the actual container ID.
docker exec -it <CONTAINER_ID> bash
- Execute the following command in the container to call the model to verify whether the deployed model can perform inference normally.
curl -X POST http://127.0.0.1:30300/v1/chat/completions -H "Content-Type: application/json" -d '{
"content": "Please answer directly: What is 1+1?"
- This topic only describes the parameters used for verification.
Last updated: 2026.06.25 10:27:49