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]: Batched Matrix-Vector Multiplication does not work correctly #1645

Closed
FOsterfeld opened this issue Sep 11, 2024 · 1 comment · Fixed by #1646
Closed

[Bug]: Batched Matrix-Vector Multiplication does not work correctly #1645

FOsterfeld opened this issue Sep 11, 2024 · 1 comment · Fixed by #1646
Assignees
Labels
bug Something isn't working

Comments

@FOsterfeld
Copy link
Member

What happened?

During testing, I found that PyTorch's matmul does not support batched matrix-vector multiplication. If an argument has more than two dimensions, the shapes, including the batch dimensions, are simply broadcasted and it is treated as a batched matrix-matrix multiplication. As a result, batched matrix-vector multiplication (#1261) does not work in all cases.

Since this is not supported by PyTorch itself, and since one can just use unsqueeze/expand_dims to handle this, I would suggest removing this functionality from Heat, and maybe raising a NotImplementedError.

Relevant link: Matrix-vector multiply (handling batched data) - PyTorch Forums

Code snippet triggering the error

No response

Error message or erroneous outcome

No response

Version

main (development branch)

Python version

None

PyTorch version

None

MPI version

No response

@FOsterfeld FOsterfeld added the bug Something isn't working label Sep 11, 2024
@FOsterfeld FOsterfeld self-assigned this Sep 11, 2024
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant