[Reland] [functorch] Fix linalg batch rules to error on non-matrix inputs#82176
[Reland] [functorch] Fix linalg batch rules to error on non-matrix inputs#82176samdow wants to merge 22 commits intogh/samdow/15/basefrom
Conversation
[ghstack-poisoned]
🔗 Helpful links
✅ No Failures (2 Pending)As of commit b78bba1 (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. |
|
I wasn't able to add the testing I wanted where we check that the error we get on a vector is the same as a matrix...somehow that failed locally for things where the batch rule wasn't implemented? Any other thoughts on how to test this are welcome though! |
…inputs" [ghstack-poisoned]
zou3519
left a comment
There was a problem hiding this comment.
some minor comments/questions
| return moveBatchDimToFront(tensor, batch_dim); | ||
| } | ||
|
|
||
| static oneOutput apply_one( |
There was a problem hiding this comment.
(no action required) In c++17 we can create a single function that takes the number of returns as a template argument, using constexpr_if. e.g. https://stackoverflow.com/questions/59046161/how-to-change-the-return-type-depending-on-the-input-c . Unfortunately pytorch is still on c++14
What failed locally? |
…inputs" [ghstack-poisoned]
So the basic of the test was this: go through the sample inputs for every Occassionally we'll get errors like: We could also just do a check that the the first part of this matches the function being called but I'm not fully convinced that it's always correct? I guess I could check that EDIT: just checked and it's not always true that the first part matches the exact function being called (ex: linalg.svdvals will error with an error starting with linalg.svd) |
…inputs" [ghstack-poisoned]
…inputs" [ghstack-poisoned]
…inputs" [ghstack-poisoned]
…inputs" [ghstack-poisoned]
…inputs" [ghstack-poisoned]
…inputs" [ghstack-poisoned]
|
@pytorchbot rebase |
|
@pytorchbot successfully started a rebase job. Check the current status here |
…inputs" [ghstack-poisoned]
|
Successfully rebased |
…inputs" [ghstack-poisoned]
|
@zou3519 when you get a chance to look again, this now has the test we discussed offline that just checks that every function in linalg and tests that it errors if being passed a 1D tensor. The only cases it's skipping at (1) vector_norm which should accept 1D vectors or (2) multi_dot which accepts a list of tensors. This gets its own test case since there's rules around what can and can't be 1D |
…inputs" [ghstack-poisoned]
|
@pytorchbot successfully started a merge job. Check the current status here |
|
Hey @samdow. |
|
@pytorchbot revert -m "This looks like it's breaking functorch tests on master" -c nosignal |
|
@pytorchbot successfully started a revert job. Check the current status here |
|
@samdow your PR has been successfully reverted. |
…uts (#82176)" This reverts commit 1dfcad8. Reverted #82176 on behalf of https://github.com/zengk95 due to This looks like it's breaking functorch tests on master
…inputs" [ghstack-poisoned]
…n-matrix inputs" [ghstack-poisoned]
…176) (#82176) Summary: X-link: pytorch/pytorch#82176 Approved by: https://github.com/zou3519 Reviewed By: kit1980 Differential Revision: D38359527 Pulled By: samdow fbshipit-source-id: f41ecc073deaa5d45f5e2733e31cc086a33716f0
) (#82176) Summary: Pull Request resolved: #82176 Approved by: https://github.com/zou3519 Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/1dfcad84aaad9c095b4dbbdafd5c351e9a712d45 Reviewed By: kit1980 Differential Revision: D38359527 Pulled By: samdow fbshipit-source-id: f41ecc073deaa5d45f5e2733e31cc086a33716f0
|
@pytorchbot merge |
|
@pytorchbot successfully started a merge and created land time checks. See merge status here and land check progress here. |
…puts (#82176) Pull Request resolved: #82176 Approved by: https://github.com/zou3519
|
Hey @samdow. |
…uts (#82176)" Summary: This reverts commit 1dfcad84aaad9c095b4dbbdafd5c351e9a712d45. Reverted pytorch/pytorch#82176 on behalf of https://github.com/zengk95 due to This looks like it's breaking functorch tests on master Reviewed By: kit1980 Differential Revision: D38394721 fbshipit-source-id: 0aedbc4d8284ce3055df5d6768858199f06f230e
…uts (#82176)" Summary: This reverts commit 1dfcad8. Reverted #82176 on behalf of https://github.com/zengk95 due to This looks like it's breaking functorch tests on master Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/31292599eb8ab41a8f5ac9ced3a5efca1fc0b627 Reviewed By: kit1980 Differential Revision: D38394721 fbshipit-source-id: 0aedbc4d8284ce3055df5d6768858199f06f230e
…puts (#82176) (#82176) Summary: X-link: pytorch/pytorch#82176 Approved by: https://github.com/zou3519 Reviewed By: kit1980 Differential Revision: D38395303 Pulled By: samdow fbshipit-source-id: ea69a28d2d413f4194ed6e96bdeaeaba6c01a3a1
…puts (#82176) (#82176) Summary: Pull Request resolved: #82176 Approved by: https://github.com/zou3519 Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/fbbd036871406a3895607a79dc58dc08551df486 Reviewed By: kit1980 Differential Revision: D38395303 Pulled By: samdow fbshipit-source-id: ea69a28d2d413f4194ed6e96bdeaeaba6c01a3a1
Stack from ghstack (oldest at bottom):