-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[ready] Introduce chain_matmul #12380
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
Conversation
|
One benchmark on the CPU (taken out of an exercise in CLRS): |
|
I'm not sure einsum is the best thing to compare this to. Could you do a direct comparision with m1 @ m2 @ m3 @... @ m6 ? |
|
|
@zou3519 This is ready for review. |
|
Eh is there any chance to revert the reshuffling? It makes the diff unnecessarily large. Those changes are completely meaningless unless they are enforced by the CI, because I'm sure that the order will be messed up in a week or two. |
torch/functional.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/functional.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
I think this is nice! Question: can't those cost function optimizations be used in einsum as well? |
|
@fmassa I went through the einsum implementation, and it seems to use a lot of permutations for preprocessing the operands. With the current implementation, I am not sure if these optimizations can be leveraged. |
|
BTW is |
|
NumPy calls it |
|
Well since we're not calling it that anyway, why not clean up the |
|
I am sorry to disappoint with the name. Regarding the name of the function, I'll name it An extension to a |
|
Can we just make it Also, don't stress out about the name! That's what NumPy calls it, so it was a very reasonable choice too. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/functional.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/functional.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/functional.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
ssnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Algorithm looks correct to me. :)
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@vishwakftw Our CircleCI build has a problem that can be fixed by |
|
@ssnl is this good to go? |
ssnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@pytorchbot retest this please |
|
Sorry, pytorch bot doesn't work with circlr ci unfortunately. Could you rebase and push again? Thanks! |
- This was the only function left out from the list of functions in NumPy's linalg module - `multi_mm` is particularly useful for DL research, for quick analysis of deep linear networks To do: - Add tests
N.B.: I took the opportunity of shuffling some of the functions based on alphabetical order
- This seems to have gotten missed out from the rebase
|
I think our windows builds are broken so you can ignore those. The asan failure seems to be real though |
|
@zou3519 I have fixed it |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SsnL is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: - This was one of the few functions left out from the list of functions in NumPy's `linalg` module - `multi_mm` is particularly useful for DL research, for quick analysis of deep linear networks - Added tests and doc string Pull Request resolved: pytorch/pytorch#12380 Differential Revision: D10357136 Pulled By: SsnL fbshipit-source-id: 52b44fa18d6409bdeb76cbbb164fe4e88224458e
NumPy's
linalgmodulemulti_mmis particularly useful for DL research, for quick analysis ofdeep linear networks