47  
查询码: 00000081
vLLM下的大模型测试( glm-4-9b ,x86架构,ubuntu系统为例)
专家 2024年12月03日 发布 ,于 2025年05月14日 编辑

1 创建docker镜像并启动docker容器

bash corex-docker-installer-4.1.2-10.2-ubuntu20.04-py3.10-x86_64.run

docker run -d --shm-size="32g" -it -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /dev:/dev -v /home:/home --name=test --privileged --cap-add=ALL --pid=host corex:4.1.2

docker exec -it test /bin/bash

2 准备测试依赖包和数据集

cd /home

bash llm-inference-benchmark-corex-4.1.2.run

下载并解压数据集:

https://huggingface.co/datasets/THUDM/LongBench/resolve/main/data.zip

cp data.zip /home/llm-inference-benchmark/text-generation-inference

unzip data.zip

3 下载模型权重

apt-get install git-lfs curl

git clone https://hf-mirror.com/THUDM/glm-4-9b  

4 大模型测试

cd /home/llm-inference-benchmark/vllm/glm

bash test_glm.sh --num-prompts 1 --input-tokens 512 --output-tokens 512 --repeat-time 3 --model /home/glm-4-9b -tp 1 --max-num-seqs 1 --max-num-batched-tokens 20000 --max-model-len 2048 --trust-remote-code --distributed-executor-backend ray




天数智芯知识库系统 -V 5.2.5 -wcp