Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPT-2: Wrong shape in model file: got [768, 2304], expected [2304, 768] #67

Closed
donge opened this issue Apr 5, 2023 · 1 comment
Closed

Comments

@donge
Copy link

donge commented Apr 5, 2023

Hello,
I met the wrong shape in the model file, does anyone know how to resolve this?

➜  build git:(master) make -j4 gpt-2
Consolidate compiler generated dependencies of target ggml_utils
Consolidate compiler generated dependencies of target ggml
[ 33%] Built target ggml_utils
[ 66%] Built target ggml
Consolidate compiler generated dependencies of target gpt-2
[100%] Built target gpt-2
➜  build git:(master) ../examples/gpt-2/download-ggml-model.sh 117M
Downloading ggml model 117M ...
models/gpt-2-117M/ggml-mod 100%[======================================>] 239.58M  41.3MB/s    in 6.2s
Done! Model '117M' saved in 'models/gpt-2-117M/ggml-model.bin'
You can now use it like this:

  $ ./bin/gpt-2 -m models/gpt-2-117M/ggml-model.bin -p "This is an example"

➜  build git:(master) ./bin/gpt-2 -m models/gpt-2-117M/ggml-model.bin -p "This is an example"

main: seed = 1680664186
gpt2_model_load: loading model from 'models/gpt-2-117M/ggml-model.bin'
gpt2_model_load: n_vocab = 50257
gpt2_model_load: n_ctx   = 1024
gpt2_model_load: n_embd  = 768
gpt2_model_load: n_head  = 12
gpt2_model_load: n_layer = 12
gpt2_model_load: f16     = 1
gpt2_model_load: ggml ctx size = 384.74 MB
gpt2_model_load: memory size =    72.00 MB, n_mem = 12288
gpt2_model_load: tensor 'model/h0/attn/c_attn/w' has wrong shape in model file: got [768, 2304], expected [2304, 768]
main: failed to load model from 'models/gpt-2-117M/ggml-model.bin'
@pikalover6
Copy link
Contributor

Model format recently changed, try converting the original model.

CCLDArjun pushed a commit to CCLDArjun/ggml that referenced this issue Dec 18, 2023
* 10% performance boost on ARM

* Back to original change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants