Skip to content

convert: allow using quantized Mistral weight - #17889

Merged
ngxson merged 3 commits into
ggml-org:masterfrom
ngxson:xsn/devstral2_convert
Dec 10, 2025
Merged

ngxson merged 3 commits into
ggml-org:masterfrom
ngxson:xsn/devstral2_convert

Conversation

@ngxson

@ngxson ngxson commented Dec 9, 2025 •

Copy link
Copy Markdown
Collaborator

target model: https://huggingface.co/mistralai/Devstral-Small-2-24B-Instruct-2512

need --mistral-format, otherwise it has problem with tokenizer if you have problem with tokenizer conversion, install transformers version 5.0.0

@pwilkin

pwilkin commented Dec 9, 2025

Copy link
Copy Markdown
Member
Traceback (most recent call last):
  File "/devel/tools/llama.cpp/convert_hf_to_gguf.py", line 10635, in <module>
    main()
    ~~~~^^
  File "/devel/tools/llama.cpp/convert_hf_to_gguf.py", line 10629, in main
    model_instance.write()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/devel/tools/llama.cpp/convert_hf_to_gguf.py", line 660, in write
    self.prepare_tensors()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/devel/tools/llama.cpp/convert_hf_to_gguf.py", line 2540, in prepare_tensors
    super().prepare_tensors()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/devel/tools/llama.cpp/convert_hf_to_gguf.py", line 531, in prepare_tensors
    for new_name, data_torch in (self.modify_tensors(data_torch, name, bid)):
                                 ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/devel/tools/llama.cpp/convert_hf_to_gguf.py", line 2862, in modify_tensors
    assert data_torch.nelement() == 0 # unused by the model
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

@ngxson

This comment was marked as resolved.

@ngxson

ngxson commented Dec 9, 2025 •

Copy link
Copy Markdown
Collaborator Author

should work now with --mistral-format

Co-authored-by: compilade <[email protected]>
@bartowski1182

Copy link
Copy Markdown
Contributor

confirming this works :)

https://huggingface.co/bartowski/mistralai_Devstral-Small-2-24B-Instruct-2512-GGUF

LGTM!

@github-actions github-actions Bot added the python python script changes label Dec 9, 2025
@ngxson
ngxson marked this pull request as ready for review December 9, 2025 22:44
@ngxson
ngxson requested a review from CISC as a code owner December 9, 2025 22:44
@ngxson
ngxson merged commit 9e79b01 into ggml-org:master Dec 10, 2025
blime4 referenced this pull request in blime4/llama.cpp Feb 5, 2026
* convert: allow using quantized Mistral weight

* data_torch.ndim

* update dequant fn

Co-authored-by: compilade <[email protected]>

---------

Co-authored-by: compilade <[email protected]>
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* convert: allow using quantized Mistral weight

* data_torch.ndim

* update dequant fn

Co-authored-by: compilade <[email protected]>

---------

Co-authored-by: compilade <[email protected]>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* convert: allow using quantized Mistral weight

* data_torch.ndim

* update dequant fn

Co-authored-by: compilade <[email protected]>

---------

Co-authored-by: compilade <[email protected]>
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
* convert: allow using quantized Mistral weight

* data_torch.ndim

* update dequant fn

Co-authored-by: compilade <[email protected]>

---------

Co-authored-by: compilade <[email protected]>
MrLordCat referenced this pull request in MrLordCat/llama.cpp-rdna-lab Jul 16, 2026
* convert: allow using quantized Mistral weight

* data_torch.ndim

* update dequant fn

Co-authored-by: compilade <[email protected]>

---------

Co-authored-by: compilade <[email protected]>
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
* convert: allow using quantized Mistral weight

* data_torch.ndim

* update dequant fn

Co-authored-by: compilade <[email protected]>

---------

Co-authored-by: compilade <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants