[BUG] llama_cpp: the GGUF file gets a random general.name, so the same build never has the same SHA-256
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从src/pruna/algorithms/llama_cpp.py开始,跟踪_convert_to_gguf(),直到它构建convert_hf_to_gguf.py命令的位置。检查模型名称的获取方式以及传递给转换器的方式,然后查找涵盖 GGUF 转换的相关测试。完成的标准是:对同一模型重复构建时使用稳定的general.name;报告还要求为该行为添加测试。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
_convert_to_gguf() in src/pruna/algorithms/llama_cpp.py saves the model into a tempfile.TemporaryDirectory and runs convert_hf_to_gguf.py on that folder without --model-name. When no name comes from the model card, the converter falls back to the folder name for general.name (convert_hf_to_gguf.py at the pinned b8958, lines 901 to 903). So every GGUF file carries a random name like tmpk3x9..., and two builds of the same model can never have the same SHA-256.
What I did
Smashed Qwen2.5-Coder-1.5B-Instruct three times with
SmashConfig({"llama_cpp": {"quantization_method": "q4_k_m", "n_gpu_layers": 0}}, device="cpu")
and compared the files:
- same file size in all three runs
- three different SHA-256 hashes
- three different model names in the logs, each the name of the temp folder
- the same answers on the same 200 Spider questions
Expected behavior
The same model and settings give the same file, or at least a stable general.name, so a checksum can show that the smashed model is the one that was evaluated.
Environment
- pruna version: 0.3.5
- python version: 3.12
- Operating System: Ubuntu (GitHub-hosted runner), x86_64, CPU only
Additional context
convert_hf_to_gguf.py has a --model-name option, and gguf/metadata.py lets it override the name. Passing a stable name, for example the last part of model.config._name_or_path, would fix it:
convert_cmd += ["--model-name", model_id]
I can open a PR with a test that builds twice and compares the names. Found while building a text-to-SQL benchmark on pruna (the same one as #800).
- 主要语言
- Python
- 星标
- 1.4k
- 派生
- 129
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PrunaAI/pruna 的其他 Issue
-
[BUG] set_to_eval calls Llama.eval() on llama.cpp models, so latency/energy/memory metrics log a warning on every run可能已有人在做 @zuhalsicim 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
[FEATURE] Add speculative decoding to the decoder algorithm family可能已有人在做 @mohityadav8 于 6 天前认领。 未关闭enhancement
难度 4/5 3-5 天 新手友好度 42/100
-
[BUG] kvpress algorithm: KVzipPress and FastKVzipPress never compress during generate可能重新可做 关联的 PR 已关闭且未合并。 未关闭stale
难度 4/5 3-5 天 新手友好度 55/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
comet-ml/opik#9877 · 1 个 reaction ·
维护者通常 1 天内回复
-
resource-submission validation-passed
难度 1/5 1 小时以内 新手友好度 80/100
hesreallyhim/awesome-claude-code#3736 · 1 条评论 ·
-
area: trackers bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Review: WordPress copy/snapshot download media with no size cap and a hostname-only origin check未关闭performance product:quill
难度 2/5 1-3 小时 新手友好度 72/100
Community-Access/quill#2634 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复