# A3
export IMAGE=swr.cn-southwest-2.myhuaweicloud.com/base_image/dockerhub/lmsysorg/sglang:cann8.5.0-a3-tbnb20260417
# A2
# export IMAGE=swr.cn-southwest-2.myhuaweicloud.com/base_image/dockerhub/lmsysorg/sglang:cann8.5.0-910b-tbnb20260417
docker run -itd --shm-size=128g --privileged=true --name sgl-a3 \
--privileged=true --net=host \
-v /mnt:/mnt \
-v /home:/home \
-v /data:/data \
-v /var/queue_schedule:/var/queue_schedule \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-v /usr/local/sbin:/usr/local/sbin \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
-v /usr/local/Ascend/firmware:/usr/local/Ascend/firmware \
--device=/dev/davinci0:/dev/davinci0 \
--device=/dev/davinci1:/dev/avinci1 \
--device=/dev/davinci2:/dev/davinci2 \
--device=/dev/davinci3:/dev/davinci3 \
--device=/dev/davinci4:/dev/davinci4 \
--device=/dev/davinci5:/dev/davinci5 \
--device=/dev/davinci6:/dev/davinci6 \
--device=/dev/davinci7:/dev/davinci7 \
--device=/dev/davinci8:/dev/davinci8 \
--device=/dev/davinci9:/dev/davinci9 \
--device=/dev/davinci10:/dev/davinci10 \
--device=/dev/davinci11:/dev/davinci11 \
--device=/dev/davinci12:/dev/davinci12 \
--device=/dev/davinci13:/dev/davinci13 \
--device=/dev/davinci14:/dev/davinci14 \
--device=/dev/davinci15:/dev/davinci15 \
--device=/dev/davinci_manager:/dev/davinci_manager \
--device=/dev/hisi_hdc:/dev/hisi_hdc \
--entrypoint=bash \
${IMAGES_ID}
# 进入容器
docker exec -it ${CONTIAINER_NAME} bash
# 设置环境变量
source /usr/local/Ascend/ascend-toolkit/latest/opp/vendors/customize/bin/set_env.bash
source /usr/local/Ascend/ascend-toolkit/latest/opp/vendors/custom_transformer/bin/set_env.bash
curl --location 'http://127.0.0.1:6699/generate' --header 'Content-Type: application/json' --data '{ "text": "The capital of China is", "sampling_params": { "temperature": 0, "max_new_tokens": 64 }}'
"text":" Beijing. It is located in the northern part of the country and serves as the political, cultural, and educational center of China. Beijing is one of the four municipalities under the direct administration of the central government, along with Shanghai, Tianjin, and Chongqing.\n\nBeijing has a rich history dating back over 3,000 years. It has been the capital of several dynasties, including the Yuan, Ming, and Qing dynasties. The city is known for its historical landmarks, such as the Great Wall, the Forbidden City, and the Temple of Heaven.\n\nIn addition to its historical significance, Beijing is also a modern metropolis with a population of over 21 million people. It is home to many important institutions, including the Chinese government, the Communist Party of China, and the People's Liberation Army.\n\nBeijing is also a major transportation hub, with an extensive network of highways, railways, and airports. The city is served by Beijing Capital International Airport, which is one of the busiest",
基于SGLang的快速上手体验
第一步:软件硬件准备
在体验之前,需确认固件/驱动已正确安装,可运行如下命令确认:
第二步,安装软件
容器方式拉起镜像
可以使用如下命令,一键拉起 SGLang 容器镜像:
第三步,启动推理服务
启动命令
预期结果