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

mat1 and mat2 shapes cannot be multiplied (1000x768 and 4096x256) #83

Open
PandaDalin opened this issue May 15, 2024 · 6 comments
Open

Comments

@PandaDalin
Copy link

RuntimeError: mat1 and mat2 shapes cannot be multiplied (1000x768 and 4096x256)

@PandaDalin
Copy link
Author

未修改llm_dim的维数

@kwuking
Copy link
Collaborator

kwuking commented May 27, 2024

具体是哪里报错呢,可以有有详细的运行日志嘛

@PandaDalin
Copy link
Author

具体是哪里报错呢,可以有有详细的运行日志嘛

是因为大模型的底座没修改,llama的最大长度是768,参考主函数的llm_dim维度参数

@kwuking
Copy link
Collaborator

kwuking commented May 27, 2024

好的 所以现在还有问题嘛?

@1767773043
Copy link

运行时错误:mat1 和 mat2 形状无法相乘(1000x768 和 4096x256),
请问应该怎么改呢

@1767773043
Copy link

0it [00:00, ?it/s]
Traceback (most recent call last):
File "/home/gf-shu/wsb/Time-LLM-main/run_main.py", line 260, in
outputs = model(batch_x, batch_x_mark, dec_inp, batch_y_mark)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/deepspeed/utils/nvtx.py", line 15, in wrapped_fn
ret_val = func(*args, **kwargs)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/deepspeed/runtime/engine.py", line 1852, in forward
loss = self.module(*inputs, **kwargs)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/home/gf-shu/wsb/Time-LLM-main/models/TimeLLM.py", line 197, in forward
dec_out = self.forecast(x_enc, x_mark_enc, x_dec, x_mark_dec)
File "/home/gf-shu/wsb/Time-LLM-main/models/TimeLLM.py", line 242, in forecast
enc_out = self.reprogramming_layer(enc_out, source_embeddings, source_embeddings)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/home/gf-shu/wsb/Time-LLM-main/models/TimeLLM.py", line 287, in forward
source_embedding = self.key_projection(source_embedding).view(S, H, -1)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/home/gf-shu/anaconda3/envs/time_llm/lib/python3.10/site-packages/torch/nn/modules/linear.py", line 116, in forward
return F.linear(input, self.weight, self.bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (1000x768 and 4096x1024)

Process finished with exit code 1

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