Windows: conflicts with llama-cpp-python 0.3.37 ggml DLLs in the same process

未关闭
#202 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend, devtools

调研方向

Start by reviewing the Windows DLL loading and bundled ggml library naming in ggml-python, then compare the bundled ggml version with llama-cpp-python 0.3.37. Use the linked Windows CI matrix to reproduce both import orders on Python 3.11. Done means both packages import and the reported ggml call works in either order on Windows.

由索引模型根据 Issue 内容生成。

描述

On Windows, when ggml-python 0.0.45 and llama-cpp-python are used in the same process, both packages load a DLL named ggml and the second import reuses the one already loaded:

  • llama_cpp imported first, llama-cpp-python 0.3.37: ggml-python calls into llama-cpp's newer ggml build and crashes. For example ggml_gallocr_new(ggml_backend_get_default_buffer_type(backend)) raises OSError: exception: access violation writing 0x0000000000000000. With llama-cpp-python 0.3.36 the same code works.
  • ggml imported first (either version): llama_cpp fails to load with Failed to load shared library '...\llama_cpp\lib\llama.dll': [WinError 127] The specified procedure could not be found.

Linux and macOS are not affected. A Windows CI matrix that reproduces both cases is here: https://github.com/MaiAditya/txtai/actions/runs/44072580894 (Python 3.11, windows-latest). This came up in txtai, see neuml/txtai#1584.

Would updating the bundled ggml to the version used by current llama-cpp-python releases be possible? That would make the first case work again. Longer term, giving the bundled DLLs a package-specific name would avoid the clash entirely.

主要语言
Python
星标
152
派生
17
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

abetlen/ggml-python 的其他 Issue

查看 abetlen/ggml-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。