You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing an issue where dequantized GGUF tensors don't match the original PyTorch model tensors, except for the first column. I have use gguf.quants.quantize
Environment
Model: Llama 3.2 1B Instruct (Q8_0 quantization)
GGUF file: unsloth/Llama-3.2-1B-Instruct-GGUF from huggingface
Original model loaded with torch_dtype=torch.float32
Code
python
# Loading original PyTorch model
torch_model = modeling_llama.LlamaModel.from_pretrained(
"meta-llama/Llama-3.2-1B-Instruct",
torch_dtype=torch.float32
).eval()
# Loading GGUF and dequantizing
reader = GGUFReader("/path/to/Llama-3.2-1B-Instruct-Q8_0.gguf")
target_tensor = None
for tensor in reader.tensors:
if tensor.name == "blk.0.attn_k.weight":
target_tensor = tensor
break
# Comparing tensors
t1 = torch.from_numpy(dequantized_tensor) # GGUF dequantized
t2 = torch_model.state_dict()["layers.0.self_attn.k_proj.weight"] # Original PyTorch
Issue
The tensors have the same shape (512, 2048), but the values don't align correctly:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm experiencing an issue where dequantized GGUF tensors don't match the original PyTorch model tensors, except for the first column. I have use gguf.quants.quantize
Environment
Model: Llama 3.2 1B Instruct (Q8_0 quantization)
GGUF file: unsloth/Llama-3.2-1B-Instruct-GGUF from huggingface
Original model loaded with torch_dtype=torch.float32
Code
python
Issue
The tensors have the same shape (512, 2048), but the values don't align correctly:
python
Expected Behavior
Dequantized GGUF tensors should closely match the original PyTorch model tensors across all rows and columns, not just the first column.
Beta Was this translation helpful? Give feedback.
All reactions