[GH-ISSUE #10334] Support microsoft/bitnet-b1.58-2B-4T #53300

Closed
opened 2026-04-29 02:33:37 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @liudonghua123 on GitHub (Apr 18, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10334

Hi, I downloaded the gguf of microsoft/bitnet-b1.58-2B-4T via huggingface-cli download microsoft/bitnet-b1.58-2B-4T-gguf --local-dir bitnet-b1.58-2B-4T and created a Makefile which contains FROM ./ggml-model-i2_s.gguf.

Then I tried to execute ollama create bitnet -f Makefile, but it failed with the following errors.

> cd bitnet-b1.58-2B-4T\

> ollama create bitnet -f Makefile
gathering model components
copying file sha256:13939ce5030319a35db346e5dba7a3a3bd599dfc18b113a2a97446ff964714c5 100%
parsing GGUF
Error: invalid file magic

>
Originally created by @liudonghua123 on GitHub (Apr 18, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10334 Hi, I downloaded the gguf of [microsoft/bitnet-b1.58-2B-4T](https://hf-mirror.com/microsoft/bitnet-b1.58-2B-4T-gguf) via `huggingface-cli download microsoft/bitnet-b1.58-2B-4T-gguf --local-dir bitnet-b1.58-2B-4T` and created a Makefile which contains `FROM ./ggml-model-i2_s.gguf`. Then I tried to execute `ollama create bitnet -f Makefile`, but it failed with the following errors. ```shell > cd bitnet-b1.58-2B-4T\ > ollama create bitnet -f Makefile gathering model components copying file sha256:13939ce5030319a35db346e5dba7a3a3bd599dfc18b113a2a97446ff964714c5 100% parsing GGUF Error: invalid file magic > ```
GiteaMirror added the model label 2026-04-29 02:33:37 -05:00
Author
Owner
<!-- gh-comment-id:2814407180 --> @liudonghua123 commented on GitHub (Apr 18, 2025): I find some similar issues, https://github.com/ollama/ollama/issues/2821, https://github.com/ollama/ollama/issues/10313, https://github.com/ollama/ollama/issues/7289.
Author
Owner

@rick-github commented on GitHub (Apr 18, 2025):

https://github.com/ggml-org/llama.cpp/issues/12997

The GGUF file uses a GGML quantization type of 36 which is not supported in llama.cpp or ollama. As a result the block size for those tensors is 0, which causes a misalignment in the tensor read culminating in an invalid file magic error because the read doesn't reach the end of the file.

$ dumpgguf ggml-model-i2_s.gguf
INFO:gguf-dump:* Loading: ggml-model-i2_s.gguf
Traceback (most recent call last):
  File "/app/gguf-py/gguf/scripts/gguf_dump.py", line 454, in <module>
    main()
  File "/app/gguf-py/gguf/scripts/gguf_dump.py", line 439, in main
    reader = GGUFReader(args.model, 'r')
  File "/app/gguf-py/gguf/gguf_reader.py", line 182, in __init__
    self._build_tensors(offs, tensors_fields)
  File "/app/gguf-py/gguf/gguf_reader.py", line 325, in _build_tensors
    ggml_type = GGMLQuantizationType(raw_dtype[0])
  File "/usr/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: 36 is not a valid GGMLQuantizationType
<!-- gh-comment-id:2815404819 --> @rick-github commented on GitHub (Apr 18, 2025): https://github.com/ggml-org/llama.cpp/issues/12997 The GGUF file uses a GGML quantization type of 36 which is not supported in llama.cpp or ollama. As a result the block size for those tensors is 0, which causes a misalignment in the tensor read culminating in an `invalid file magic` error because the read doesn't reach the end of the file. ``` $ dumpgguf ggml-model-i2_s.gguf INFO:gguf-dump:* Loading: ggml-model-i2_s.gguf Traceback (most recent call last): File "/app/gguf-py/gguf/scripts/gguf_dump.py", line 454, in <module> main() File "/app/gguf-py/gguf/scripts/gguf_dump.py", line 439, in main reader = GGUFReader(args.model, 'r') File "/app/gguf-py/gguf/gguf_reader.py", line 182, in __init__ self._build_tensors(offs, tensors_fields) File "/app/gguf-py/gguf/gguf_reader.py", line 325, in _build_tensors ggml_type = GGMLQuantizationType(raw_dtype[0]) File "/usr/lib/python3.10/enum.py", line 385, in __call__ return cls.__new__(cls, value) File "/usr/lib/python3.10/enum.py", line 710, in __new__ raise ve_exc ValueError: 36 is not a valid GGMLQuantizationType ```
Author
Owner

@qdrddr commented on GitHub (Apr 18, 2025):

This is because it's intended to be run with bitnet.cpp
https://github.com/microsoft/BitNet

<!-- gh-comment-id:2815479230 --> @qdrddr commented on GitHub (Apr 18, 2025): This is because it's intended to be run with bitnet.cpp https://github.com/microsoft/BitNet
Author
Owner

@electriquo commented on GitHub (Apr 18, 2025):

relates to https://github.com/ollama/ollama/issues/10337

<!-- gh-comment-id:2815876584 --> @electriquo commented on GitHub (Apr 18, 2025): relates to https://github.com/ollama/ollama/issues/10337
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#53300