GPTQ-for-LLaMa icon indicating copy to clipboard operation
GPTQ-for-LLaMa copied to clipboard

Having trouble using saved models

Open dnhkng opened this issue 1 year ago • 1 comments

When I try and use the model, I see errors on very layer in the model:

        size mismatch for model.layers.77.mlp.down_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([172, 8192]).
        size mismatch for model.layers.77.mlp.up_proj.scales: copying a param with shape torch.Size([22016, 1]) from checkpoint, the shape in current model is torch.Size([64, 22016]).
        size mismatch for model.layers.78.self_attn.q_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([64, 8192]).
        size mismatch for model.layers.78.self_attn.k_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([64, 8192]).
        size mismatch for model.layers.78.self_attn.v_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([64, 8192]).
        size mismatch for model.layers.78.self_attn.o_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([64, 8192]).
        size mismatch for model.layers.78.mlp.gate_proj.scales: copying a param with shape torch.Size([22016, 1]) from checkpoint, the shape in current model is torch.Size([64, 22016]).
        size mismatch for model.layers.78.mlp.down_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([172, 8192]).
        size mismatch for model.layers.78.mlp.up_proj.scales: copying a param with shape torch.Size([22016, 1]) from checkpoint, the shape in current model is torch.Size([64, 22016]).
        size mismatch for model.layers.79.self_attn.q_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([64, 8192]).
        size mismatch for model.layers.79.self_attn.k_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([64, 8192]).
        size mismatch for model.layers.79.self_attn.v_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([64, 8192]).
        size mismatch for model.layers.79.self_attn.o_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([64, 8192]).
        size mismatch for model.layers.79.mlp.gate_proj.scales: copying a param with shape torch.Size([22016, 1]) from checkpoint, the shape in current model is torch.Size([64, 22016]).
        size mismatch for model.layers.79.mlp.down_proj.scales: copying a param with shape torch.Size([8192, 1]) from checkpoint, the shape in current model is torch.Size([172, 8192]).
        size mismatch for model.layers.79.mlp.up_proj.scales: copying a param with shape torch.Size([22016, 1]) from checkpoint, the shape in current model is torch.Size([64, 22016]).

I and using this commend to run the model: python llama.py /mnt/data2/llama_weighs/llama-65b-hf/ c4 --wbits 4 --groupsize 128 --load /mnt/data2/llama_weighs/llama-65b-hf/llama65b-4bit.pt --benchmark 2048 --check

I moved the generated model "llama65b-4bit.pt" into the Hugging Face model directory. Not sure if this was the right thing to do...

dnhkng avatar Mar 20 '23 15:03 dnhkng

+1 Hmm yes i also had this problem when trying to save a alpaca lora checkpoint into ggl and then quantize it the - -check command fails.

Wingie avatar Mar 21 '23 05:03 Wingie

+1 I am facing a similar issue when loading from here https://huggingface.co/maderix/llama-65b-4bit. Any help on this would be great !

infinitylogesh avatar Mar 22 '23 06:03 infinitylogesh

The code has changed due to current grouping support. please quantization the LLaMa model once again.

qwopqwop200 avatar Mar 22 '23 08:03 qwopqwop200

@qwopqwop200 I am seeing this error with T5 based models on the current T5 branch after quantization procedure.
Tried both latest HF transformers and your latest transformers fork.

example for t5-flan-small: size mismatch for decoder.block.7.layer.2.DenseReluDense.wo.scales: copying a param with shape torch.Size([8, 512]) from checkpoint, the shape in current model is torch.Size([1, 512]).

bradfox2 avatar Apr 10 '23 09:04 bradfox2

check groupsize

qwopqwop200 avatar Apr 10 '23 09:04 qwopqwop200

Thanks @qwopqwop200 - that was it.

bradfox2 avatar Apr 10 '23 15:04 bradfox2