[go: nahoru, domu]

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

[BUG] RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead. #875

Open
janelu9 opened this issue Jun 18, 2024 · 1 comment

Comments

@janelu9
Copy link
janelu9 commented Jun 18, 2024
 File "/mnt/e/nlp/Megatron-LM/megatron/legacy/model/transformer.py", line 697, in forward
[rank0]:     query_layer = query_layer.view(query_layer.size(0), query_layer.size(1), -1, self.hidden_size_per_attention_head)
[rank0]:                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
@janelu9 janelu9 changed the title [BUG] A little "view" bug [BUG] view size is not compatible with input tensor's size and stride ... Jun 18, 2024
@janelu9 janelu9 changed the title [BUG] view size is not compatible with input tensor's size and stride ... [BUG] RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead. Jun 18, 2024
@janelu9
Copy link
Author
janelu9 commented Jun 18, 2024

query_layer = query_layer.view(query_layer.size(0), query_layer.size(1), -1, self.hidden_size_per_attention_head)

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

1 participant