尧图建网站 尧图建网站 YAOTU WEB BUILD 免费咨询
ARTICLE DETAIL

资讯详情

深耕网站建设与建站编程的一线实战洞察。

Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0评估全流程:从lm-evaluation-harness安装到GSM8K测试

Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0评估全流程:从lm-evaluation-harness安装到GSM8K测试 Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0评估全流程从lm-evaluation-harness安装到GSM8K测试【免费下载链接】Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0项目地址: https://ai.gitcode.com/hf_mirrors/amd/Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0是由AMD基于Microsoft Phi-4-reasoning-plus模型量化优化的CPU推理模型采用8位权重和8位动态激活量化W8A8技术通过LLM Compressor v0.12.0实现专为AMD EPYC处理器优化可在Linux系统上通过vLLM引擎高效运行。评估准备环境与工具安装核心依赖安装评估前需确保系统已安装以下组件Python环境建议3.8版本基础依赖包pip install torch2.11.0 zentorch2.11.0.3 vllm0.26.0 llmcompressor0.12.0lm-evaluation-harness部署lm-evaluation-harness是EleutherAI开发的基准测试框架支持多种语言模型评估# 克隆官方仓库 git clone https://github.com/EleutherAI/lm-evaluation-harness cd lm-evaluation-harness # 安装依赖 pip install -e .模型获取与部署克隆模型仓库通过Git获取量化模型文件git clone https://gitcode.com/hf_mirrors/amd/Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0 cd Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0环境变量配置为确保vLLM引擎性能需设置OpenMP库加载路径# 使用LLVM OpenMP export LD_PRELOAD$(find /path/to/venv -name libomp.so | head -1) # 或Intel OpenMP export LD_PRELOAD$(find /path/to/venv -name libiomp5.so | head -1)GSM8K评估全流程评估命令解析使用lm-evaluation-harness对GSM8K数据集5-shot进行测试lm_eval \ --model vllm \ --model_args pretrainedamd/Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0,dtypebfloat16 \ --tasks gsm8k \ --batch_size auto \ --trust_remote_code \ --num_fewshot 5 \ --apply_chat_template \ --log_samples \ --gen_kwargs max_gen_toks2048 \ --output_path ./evaluation_results参数说明--model vllm指定使用vLLM推理引擎--num_fewshot 5采用5样本示例提示--apply_chat_template应用模型对话模板chat_template.jinja--output_path结果保存路径评估结果解读官方测试显示该量化模型在GSM8K5-shot任务上表现优异基准测试BF16原始模型W8A8量化模型性能恢复率GSM8K (5-shot)0.87040.8893102.17%关键发现量化模型准确率0.8893超过原始BF16模型实现102.17%的性能恢复同时磁盘空间减少46%从27.3 GiB降至14.6 GiB。常见问题解决依赖版本冲突若出现ImportError需严格匹配版本要求torch2.11.0 zentorch2.11.0.3 vllm0.26.0 llmcompressor0.12.0查看完整依赖清单requirements配置推理性能优化CPU核心配置设置OMP_NUM_THREADS为物理核心数内存分配确保系统空闲内存≥32GB量化参数参考recipe.yaml中的优化配置总结与扩展Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0通过W8A8量化实现了高效CPU推理在保持推理质量的同时显著降低资源占用。评估流程可扩展至其他基准测试如MMLU、TruthfulQA只需修改--tasks参数即可。完整评估脚本与配置文件可在项目根目录获取包括量化配置recipe.yaml模型参数config.json生成配置generation_config.json建议定期查看SECURITY.md获取安全更新遵循CODE_OF_CONDUCT.md进行模型使用与二次开发。【免费下载链接】Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0项目地址: https://ai.gitcode.com/hf_mirrors/amd/Phi-4-reasoning-plus-w8a8-llmcompressor-v0.12.0创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表