```shell # fork官方仓库 https://github.com/ggerganov/llama.cpp.git 并下载项目至本地 git clone git@github.com:{your_own}/llama.cpp.git # 进入项目,从master分支创建个人开发分支 cd llama.cpp git checkout -b local_npu_support # 编译 mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=debug -DLLAMA_CANN=on && make -j32 # 单算子精度测试 ./bin/test-backend-ops test -b CANN0 -o {OP_NAME} # e.g. ./bin/test-backend-ops test -b CANN0 -o CONT # 单算子性能测试,性能测试不会测试精度 ./bin/test-backend-ops perf -b CANN0 -o {OP_NAME} # 模型推理 ./bin/llama-cli -m /home/wangshuai/models/hermes_gguf/Hermes-2-Pro-Llama-3-8B-F16.gguf -p "Building a website can be done in 10 simple steps:" -ngl 32 -sm none -mg 0 -t 0 ``` ### 官方仓库贡献代码 欢迎广大开发者在模型支持及设备支持上贡献代码,当前支持的模型及设备列表请参考:https://github.com/ggerganov/llama.cpp/pull/8867 PR题目请添加 `[CANN]` 前缀,commit 信息使用 `cann: commit message` 的格式,reviewer: @hipudding,@wangshuai09 具体请参考:https://github.com/ggerganov/llama.cpp/pull/8822
Activity
hipudding commentedon Jul 22, 2024
310和910的接口还有一些出入,后面可以考虑做310的支持。目前还不能用
zhaohengxing commentedon Aug 14, 2024
你好,我在ascend310P3的设备上使用npu部署qwen2-1.5b-fp16.gguf,输出一直是乱码。
目前状态是:程序编译可以通过。npu算子也已经使能。但是test-backend-ops测试存在某些算子精度错误。
考虑到大概率是个别算子精度存在问题,我准备尝试进行调试和修复。
请问能否给出一些从哪里入手的具体指导,有哪些关键点需要注意?
wangshuai09 commentedon Aug 14, 2024
@zhaohengxing ,精度不对有可能是某些算子未支持的qwen2的情况,或者某些特殊情况调用了错误的算子,也有可能是不同系列的芯片接口不一致,需要更改
hipudding commentedon Aug 14, 2024
@zhaohengxing 对310p的适配代码建议提交PR,一起看看。 用例精度问题,需要针对有问题的算子debug解决精度问题,解决后应该就可以正常推理了
zhaohengxing commentedon Aug 14, 2024
多谢了!我尝试先找下问题。
github-actions commentedon Mar 9, 2025
This issue was closed because it has been inactive for 14 days since being marked as stale.
common : Fix corrupted memory error on json grammar initialization (g…
ggml webgpu: minor set rows optimization (ggml-org#16810)
ggml webgpu: add support for emscripten builds (ggml-org#17184)
ggml webgpu: initial flashattention implementation (ggml-org#18610)