Repository navigation
Description
Description:
When attempting to load the gpt-oss-20b model (multiple quantization versions), llama.cpp fails with an error about an invalid tensor type. The issue persists across different quantizations of the same model.
Error message:
gguf_init_from_file_impl: tensor 'blk.0.ffn_down_exps.weight' has invalid ggml type 39 (NONE)
gguf_init_from_file_impl: failed to read tensor info
llama_model_load: error loading model: llama_model_loader: failed to load model from I:\SKLAD\!Models_GGUF\Unsloth\gpt-oss-20b-Q4_K_M.gguf
Reproduction steps:
- Download any quantization version of gpt-oss-20b GGUF model
- Run the following command:
llama-cli.exe -m I:\SKLAD\!Models_GGUF\Unsloth\gpt-oss-20b-Q4_K_M.gguf --threads 6 --prio 2 --ctx-size 32768 --flash-attn --batch-size 24 --n-predict -2 --min-p 0.0 --mlock --no-mmap --temp 0.3 --n-gpu-layers 99 --top-k 20 --top-p 0.8 --repeat-penalty 1.0 --multiline-input --no-display-prompt
Expected behavior:
The model should load successfully and be ready for inference.
Actual behavior:
The loader fails with the same error about invalid tensor type across all quantization versions tried.
System information:
- Windows 10 [Version 10.0.19045.5487]
- NVIDIA GeForce RTX 4060 Ti (16GB VRAM)
- llama.cpp build 6082 (5aa1105d) with MSVC 19.43.34810.0 for x64
Additional information:
- The error persists across multiple quantization versions of the same model (tried Q4_K_M and others)
- The common factor is the tensor 'blk.0.ffn_down_exps.weight' having an invalid type (NONE)
- This suggests either:
- A fundamental issue with the GGUF conversion of this particular model
- An incompatibility between the model's architecture and current llama.cpp implementation
- Corrupted source files used for conversion
Troubleshooting steps attempted:
- Verified CUDA is working (device detected successfully)
- Confirmed sufficient VRAM is available (15GB free)
- Tried multiple quantization versions of the same model
- Verified file integrity (no download errors)
Microsoft Windows [Version 10.0.19045.5487]
(c) Microsoft Corporation. All rights reserved.
C:\Windows\System32>C:\llama.cpp\build\bin\Release\llama-cli.exe -m I:\SKLAD!Models_GGUF\Unsloth\gpt-oss-20b-Q4_K_M.gguf --threads 6 --prio 2 --ctx-size 32768 --flash-attn --batch-size 24 --n-predict -2 --min-p 0.0 --mlock --no-mmap --temp 0.3 --n-gpu-layers 99 --top-k 20 --top-p 0.8 --repeat-penalty 1.0 --multiline-input --no-display-prompt
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GeForce RTX 4060 Ti, compute capability 8.9, VMM: yes
build: 6082 (5aa1105d) with MSVC 19.43.34810.0 for x64
main: llama backend init
main: load the model and apply lora adapter, if any
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4060 Ti) - 15225 MiB free
gguf_init_from_file_impl: tensor 'blk.0.ffn_down_exps.weight' has invalid ggml type 39 (NONE)
gguf_init_from_file_impl: failed to read tensor info
llama_model_load: error loading model: llama_model_loader: failed to load model from I:\SKLAD!Models_GGUF\Unsloth\gpt-oss-20b-Q4_K_M.gguf
llama_model_load_from_file_impl: failed to load model
common_init_from_params: failed to load model 'I:\SKLAD!Models_GGUF\Unsloth\gpt-oss-20b-Q4_K_M.gguf'
main: error: unable to load model
C:\Windows\System32>
Activity
Oleg777778 commentedon Aug 9, 2025
Additional Context from Linux Test
Reproduced on Ubuntu 24.04 with identical failure:
Critical Findings
MoE-Specific Failure:
The 3D tensor
blk.0.ffn_down_exps.weight([2880, 2880, 32]) is not serialized correctly in GGUF, suggesting:39(NONE) is invalid for this architecture.No Workarounds Found:
Suggested Actions
vLLM(given the[vllm]tag in metadata).Priority: High
This blocks all usage of GGUF-quantized GPT-OSS-20B until resolved.
oleg@oleg-MS-7B86:~$ llama-cli \ -m /home/oleg/gpt-oss-20b-Q4_K_M.gguf \ -ngl 99 -c 16384 --temp 0.3 --multiline-input --mlock --no-mmap --batch-size 24 --threads 6 --flash-attn --prio 2 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: yes ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 1 CUDA devices: Device 0: NVIDIA GeForce RTX 4060 Ti, compute capability 8.9, VMM: yes build: 5935 (2adf8d83) with cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 for x86_64-linux-gnu main: llama backend init main: load the model and apply lora adapter, if any llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4060 Ti) - 15704 MiB free gguf_init_from_file_impl: tensor 'blk.0.ffn_down_exps.weight' has invalid ggml type 39 (NONE) gguf_init_from_file_impl: failed to read tensor info llama_model_load: error loading model: llama_model_loader: failed to load model from /home/oleg/gpt-oss-20b-Q4_K_M.gguf llama_model_load_from_file_impl: failed to load model common_init_from_params: failed to load model '/home/oleg/gpt-oss-20b-Q4_K_M.gguf' main: error: unable to load model oleg@oleg-MS-7B86:~$moonray commentedon Aug 11, 2025
I have the same problem for the 20b q5_k_m variant.
Running on windows 10, latest version of ollama 0.11.4, 3080ti.
manfreddev commentedon Aug 15, 2025
Same here, gpt-oss-20b-GGUF:UD-Q6_K_XL on Radeon 9070 (16gb, ollama 20250812 on Ubuntu + rocm)
danielhanchen commentedon Aug 15, 2025
Hey guys - you will have to build llama.cpp from source as seen in https://docs.unsloth.ai/basics/gpt-oss-how-to-run-and-fine-tune#run-gpt-oss-120b ie:
apt-get update apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y git clone https://github.com/ggml-org/llama.cpp cmake llama.cpp -B llama.cpp/build \ -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-gguf-split cp llama.cpp/build/bin/llama-* llama.cppFor Ollama, unfortunately they do not support GGUFs at the moment - they are working on it!
manfreddev commentedon Aug 16, 2025
It seems that release b6096 adds support for ggml type 39 if i am correct. Diff: ggml-org/llama.cpp@b6095...b6096
This ollama pull request relates to the llama.cpp handling of MXFP4 (comment from mxyng): ollama/ollama#11823
Changes seem to be present from 0.11.5 (https://github.com/ollama/ollama/blob/v0.11.5-rc2/ml/backend/ggml/ggml/include/ggml.h)
Oleg777778 commentedon Aug 17, 2025
Well, then why do we need such a capricious model? Moreover, I have already managed to try this same model, assembled by different authors. And everywhere there is exactly the same error.
formorter commentedon Aug 26, 2025
Got the same error with gguf gpt-oss-20b on vllm
gguf_init_from_file_impl: tensor 'blk.0.ffn_down_exps.weight' has invalid ggml type 39 (NONE)
rolandtannous commentedon Oct 15, 2025
@Nitco-Loris @Oleg777778 @formorter @manfreddev @moonray @treitmayr @ywatanabex
We just pushed a major fix for llamacpp integration.
1- Please make sure to update your local install of unsloth
If you're using a notebook on kaggle or colab, it should pull the latest version automatically.
2- You can now use
save_pretrained_ggufto quantize and save to GGUF format:For vision/multimodal models, use
tokenizer=processor3- You can pass it one or several quant methods (as a list):
or
We support all the quants mentioned in this page except the iq variants.
4- If the model is supported by Ollama, it will now also automatically create a
Modelfilefor you that you can use to create your model in ollama using:5- Use
push_to_hub_ggufif you want to convert to gguf and push to Huggingface Hub instead.6- Should work for all models supported by unsloth and ollama.
7- It now fully supports linux debian and RPM variants. We are still testing windows (if someone has a windows machine and is on our discord channel ping me to help debug)
8 - Finally, If you are on a local machine, are facing frequent dependency problems while installing/updating unsloth and can run containers, I highly recommend that you use our official docker containerized environment. No more dependency conflicts. It's safe (non root user) and comes with a prebuilt pretested environment and the most up to date notebooks for you to run. You can find the Docker container image here: https://hub.docker.com/r/unsloth/unsloth
The how to guide for the docker container can be found here: https://docs.unsloth.ai/get-started/install-and-update/docker
Thanks!
danielhanchen commentedon Sep 6, 2026
Not an Unsloth bug sorry! gpt-oss GGUFs are MXFP4 and llama.cpp only reads those from b6096, Ollama from 0.11.5. Update either one and they'll load. We don't pin an old llama.cpp so a fresh install gets the latest.