Refactor the API of the matmul implementation#75194
Closed
lezcano wants to merge 9 commits intogh/Lezcano/56/basefrom
Closed
Refactor the API of the matmul implementation#75194lezcano wants to merge 9 commits intogh/Lezcano/56/basefrom
lezcano wants to merge 9 commits intogh/Lezcano/56/basefrom
Conversation
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
Contributor
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit fe001e2 (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
This was referenced Apr 4, 2022
Closed
Closed
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
ezyang
reviewed
Apr 4, 2022
ezyang
reviewed
Apr 4, 2022
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
ngimel
reviewed
May 3, 2022
| buffer.select(0, 2), // out for a^2 | ||
| // out for a^2 | ||
| auto view_out = buffer.select(0, 2); | ||
| at::matmul_out( |
Collaborator
There was a problem hiding this comment.
why do we need to go through the dispatcher here instead of calling _matmul_impl?
Collaborator
Author
Collaborator
There was a problem hiding this comment.
The "real" calls like mm have to go through dispatcher, but calling from one composite implicit function to another composite implicit function can be whatever (for all you know, matmul can be a helper function that you are calling from another one).
Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. [ghstack-poisoned]
ngimel
approved these changes
May 4, 2022
Collaborator
|
@pytorchbot merge this |
facebook-github-bot
pushed a commit
that referenced
this pull request
May 6, 2022
Summary: Previously we used an odd overload using `c10::optional` to implement the matmul logic of `matmul` and `matmul_out` simultaneously. This made some functions (those in `linalg.matrix_exp`) call into this native::matmul implementation, rather than going through the dispatcher. In this PR we remove the use of `c10::optional` and rename the implementation of matmul, to make sure that no one mistakenly calls it. Pull Request resolved: #75194 Approved by: https://github.com/ezyang, https://github.com/ngimel Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/35ae9f68c549005932b5e3d646d67bd3439622e8 Reviewed By: malfet Differential Revision: D36171135 fbshipit-source-id: c8aaa9ce15d7cd15c76fd34459f9ee658fb791c5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
Previously we used an odd overload using
c10::optionalto implementthe matmul logic of
matmulandmatmul_outsimultaneously. This madesome functions (those in
linalg.matrix_exp) call into this native::matmulimplementation, rather than going through the dispatcher.
In this PR we remove the use of
c10::optionaland rename theimplementation of matmul, to make sure that no one mistakenly calls it.