VLLM/sglang evalscope/lm_eval MMLU等准确度评测
VLLM/sglang lm_eval MMLU等准确度评测
·
Ref
欢迎来到 EvalScope 中文教程! | EvalScope
https://github.com/EleutherAI/lm-evaluation-harness
如何使用lm-evaluation-harness零代码评估大模型
【GPT】中文大语言模型梳理与测评(C-Eval 、AGIEval、MMLU、SuperCLUE)_superclue c-eval哪个更权威-CSDN博客
Note: 本文主要针对评测本地部署的vllm/sglang部署。
评测sglang推荐使用evalscope
使用lmeval评测sglang本地部署依赖vllm导致有一些问题,推荐使用evalscope。
pip install evalscope==0.17.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
# evalscope eval -h
评测sglang本地部署
evalscope eval \
--model DeepSeek-V3.1-Terminus \
--api-url http://localhost:30000/v1 \
--api-key EMPTY \
--eval-type openai_api \
--datasets mmlu \
--dataset-args '{"mmlu": {"subset_list": ["high_school_physics", "high_school_psychology"], "few_shot_num": 5}}' \
--eval-batch-size 64
只需要评测子任务的话,加上--dataset-args。
evalscope eval \
--model DeepSeek-V3.2 \
--api-url http://localhost:30000/v1 \
--api-key EMPTY \
--eval-type openai_api \
--datasets aime25 \
--dataset-hub huggingface \
--eval-batch-size 128
使用lm_eval
lm_eval安装
# pip install lm-eval
pip install lm-eval[api]
源码安装
git clone https://github.com/EleutherAI/lm-evaluation-harness
cd lm-evaluation-harness
pip install -e .
查看支持的评测任务
lm-eval --tasks list
VLLM/SGLang serving API评测
lm_eval \
--model local-completions \
--tasks mmlu \
--batch_size=8 \
--model_args '{"model": "Qwen/Qwen3-8B-FP8", "base_url": "http://localhost:8000/v1/completions", "num_concurrent": 8}'
这个可以评测VLLM/SGLang启动的serving服务提供的api接口,从而评测VLLM/sglang不同部署方案的效果。
MMLU
除了mmlu整体评测,还可以分为4个子任务单独评测
mmlu_stem
mmlu_other
mmlu_social_sciences
mmlu_humanities
或者更精细的子任务评测。
python sglang/benchmark/gsm8k/bench_sglang.py --port 30000 --num-shots 5 --num-questions 500
火山引擎开发者社区是火山引擎打造的AI技术生态平台,聚焦Agent与大模型开发,提供豆包系列模型(图像/视频/视觉)、智能分析与会话工具,并配套评测集、动手实验室及行业案例库。社区通过技术沙龙、挑战赛等活动促进开发者成长,新用户可领50万Tokens权益,助力构建智能应用。
更多推荐



所有评论(0)