Views
No views yet
| 应用 | deepseek_v31(671b)典型用例平均提升(%) | Qwen3-4b典型用例平均提升(%) | OS领域模型典型用例平均提升(%) | OS领域模型量化典型用例平均提升(%) |
|---|---|---|---|---|
| spark | 7.52 | 3.39 | 11.09 | 17.37 |
| nginx | 190.96 | 76.42 | 158.67 | 166.51 |
| ceph | 50.43 | 33.69 | 48.38 | 50.57 |
| pgsql | 101.66 | 104.56 | 119.83 | 116.24 |
| mysql | 49.17 | 40.01 | 50.47 | 51.49 |
| 部署平台 | prefill吞吐(tokens/s) | decode吞吐(tokens/s) | 推理过程吞吐(tokens/s) | 相对基线性能提升(%) |
|---|---|---|---|---|
| 鲲鹏920 | 115.73 | 4.62 | 16.50 | / |
| 鲲鹏920优化后 | 81.68 | 7.35 | 23.15 | 40.28 |
| 鲲鹏920B | 74.28 | 42.54 | 62.60 | / |
| 鲲鹏920B优化后 | 325.23 | 36.39 | 108.98 | 74.08 |
1# 克隆之前请先确认已经安装 git-xet
2curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/huggingface/xet-core/refs/heads/main/git_xet/install.sh | sh
3git xet install
4git clone https://huggingface.co/openEuler/witty-tune-model1# 获取源码,Qwen3需要llama.cpp版本大于等于b5092
2git clone https://github.com/ggml-org/llama.cpp
3cd llama.cpp
4cmake -B build # 构建CPU推理版本
5cmake -B build -DGGML_CUDA=ON # 构建CUDA推理版本
6cmake -B build -DGGML_CANN=on -DCMAKE_BUILD_TYPE=release # 构建CANN推理版本
7cmake --build build --config Release -j $(nproc)
8# 测试
9./build/bin/llama-cli -m PATH_TO_MODEL -p "Building a website can be done in 10 steps:" -ngl 991./build/bin/llama-server -m witty-tune-model/loraplus_model_IQ4_NL.gguf --jinja -ngl 99 --temp 0.6 --top-k 20 --top-p 0.95 --min-p 0 -c 40960 -np 4 -n 32768 --no-context-shift -t 64 --host 0.0.0.0 --port 8000
2测试
3curl 'http://127.0.0.1:8000/v1/chat/completions' \
4--header 'Content-Type: application/json' \
5--data '{
6 "model": "witty-tune-model",
7 "messages": [
8 {"role": "user", "content": "你好"}
9 ],
10 "stream": false
11 }'vim config/.env.yamlLLM_KEY: "sk-123456" # 必填:模型服务的 API 密钥
LLM_URL: "http://172.168.178.107:8000" # 必填:LLM 服务的 API 接口地址,如 "https://api.deepseek.com"
LLM_MODEL_NAME: "witty-tune-model" # 必填:要调用的模型名,如 deepseek-chat
LLM_MAX_TOKENS: 8192 # 选填:生成文本的最大 token 数,如512或2048euler-copilot-tune1# 下载基线模型
2pip install modelscope
3modelscope download --model Qwen/Qwen3-4B-Instruct-2507 --local_dir ./Qwen3-4B-Instruct-2507
4# 或者使用 huggingface
5pip install huggingface_hub
6huggingface-cli download Qwen/Qwen3-4B-Instruct-2507 --local-dir ./Qwen3-4B-Instruct-25071# 下载源码
2git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git
3cd LLaMA-Factory
4
5# 创建并激活conda环境
6conda create -y -n llamafactory python=3.11
7conda activate llamafactory
8
9# 源码安装
10# cuda环境
11pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126 # 可选,根据cuda版本调整下载链接,也可直接执行下面的命令自动检测并部署
12pip install -e ".[torch,metrics]" --no-build-isolation
13# ascend npu环境
14pip install -e ".[torch-npu,metrics]" -i https://pypi.tuna.tsinghua.edu.cn/simple
15
16# 与构建镜像安装
17#c uda环境
18docker run -it --rm --gpus=all --ipc=host hiyouga/llamafactory:latest # 该镜像基于 Ubuntu 22.04(x86_64)、CUDA 12.4、Python 3.11、PyTorch 2.6.0 和 Flash-attn 2.7.4 构建。全部镜像:https://hub.docker.com/r/hiyouga/llamafactory/tags
19# ascend npu环境(暂时不支持A3型号的ascend产品)
20docker pull quay.io/ascend/llamafactory:latest-npu-a2
21docker run -dit --ipc=host --network host --name 'llamafactory' --privileged -v /usr/local/Ascend/driver:/usr/local/Ascend/driver -v /usr/local/Ascend/firmware:/usr/local/Ascend/firmware -v /usr/local/sbin/:/usr/local/sbin/ -v /home/:/home/ quay.io/ascend/llamafactory:latest-npu-a2
22docker exec -it llamafactory bash
23
24# 安装校验
25llamafactory-cli envllamafactory-cli webui1# 获取源码,Qwen3需要llama.cpp版本大于等于b5092
2git clone https://github.com/ggml-org/llama.cpp
3cd llama.cpp
4# 格式转换需要构建python库依赖
5pip install -r requirements/requirements-convert_hf_to_gguf.txt
6python convert_hf_to_gguf.py witty-tune-model/loraplus_model --outfile witty-tune-model/loraplus_model.ggufllama-quantize witty-tune-model/loraplus_model.gguf IQ4_NL