-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Modernize test-suite in sparse tensors #56392
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
minor fix [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 2cd9c73 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
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.
Hey @aocsa! Overall this looks pretty good; I have a couple suggestions and a question, but nothing major
Fixes for gh-56371 and gh-56369 Differential Revision: [D27913212](https://our.internmc.facebook.com/intern/diff/D27913212) [ghstack-poisoned]
Fixes for gh-56371 and gh-56369 Differential Revision: [D27913212](https://our.internmc.facebook.com/intern/diff/D27913212) [ghstack-poisoned]
Fixes for gh-56371 and gh-56369 Differential Revision: [D27913212](https://our.internmc.facebook.com/intern/diff/D27913212) Note: The following requests about testing listed here https://pearu.github.io/csr_tensor_support.html #50937 (comment) - see modern COO testing #50937 (comment) - don’t set default_dtype_type #50937 (comment) - avoid using numpy #50937 (comment) - inefficient CSR samples are being solved in this PR [ghstack-poisoned]
Fixes for gh-56371 and gh-56369 Differential Revision: [D27913212](https://our.internmc.facebook.com/intern/diff/D27913212) Note: The following requests about testing listed here https://pearu.github.io/csr_tensor_support.html #50937 (comment) - see modern COO testing #50937 (comment) - avoid using numpy #50937 (comment) - inefficient CSR samples are being solved in this PR [ghstack-poisoned]
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.
Thanks @aocsa , this looks good.
I have several nits but most importantly, I suggest making test_sparse_csr_constructor
method more thorough, in particular, ensure that all supported dtypes are covered as well as checking that the constructed CSR tensor have the expected dtype, device, and indices/values.
We may also want to extend these tests to other inputs such as lists and objects implementing array interface but atm this blocked by #56687 and #54187 .
Fixes for gh-56371 and gh-56369 Differential Revision: [D27913212](https://our.internmc.facebook.com/intern/diff/D27913212) Note: The following requests about testing listed [here](https://pearu.github.io/csr_tensor_support.html) #50937 (comment) - see modern COO testing #50937 (comment) - avoid using numpy #50937 (comment) - inefficient CSR samples are being solved in this PR [ghstack-poisoned]
Thanks for the feedback @pearu, I addressed the comments and rebased this PR on top of the latest changes, polished a few things, like better CSR sample input generator see #56392 (comment) and added some tests, specifically related to factory tests. I think it is ready for final review and merging, let me know what you think. cc @mruberry |
Fixes for gh-56371 and gh-56369 Differential Revision: [D27913212](https://our.internmc.facebook.com/intern/diff/D27913212) Note: The following requests about testing listed [here](https://pearu.github.io/csr_tensor_support.html) #50937 (comment) - see modern COO testing #50937 (comment) - avoid using numpy #50937 (comment) - inefficient CSR samples are being solved in this PR [ghstack-poisoned]
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.
Thanks @aocsa ! LGTM, however, there is a bug in random_sparse_csr
. Once this is fixed, I'll approve.
Fixes for gh-56371 and gh-56369 Differential Revision: [D27913212](https://our.internmc.facebook.com/intern/diff/D27913212) Note: The following requests about testing listed [here](https://pearu.github.io/csr_tensor_support.html) #50937 (comment) - see modern COO testing #50937 (comment) - avoid using numpy #50937 (comment) - inefficient CSR samples are being solved in this PR [ghstack-poisoned]
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.
Thanks, @aocsa for the fixes.
I'll approve this PR despite the wrong crow_indices[-1] <= nnz
check, see #56392 (comment) .
We'll need to resolve this incorrectness in the context of #56856 because the corresponding fix likely requires changes to the CSR construction algorithm and hence is OT for this PR.
@mruberry I think this PR is ready for merge (assuming that CI is fine with it). The PR has a high priority because other CSR-related PRs rely on this testing framework.
Summary: Pull Request resolved: pytorch#56392 Fixes for pytorchgh-56371 and pytorchgh-56369 Test Plan: Imported from OSS Reviewed By: H-Huang Differential Revision: D27913212 Pulled By: mruberry fbshipit-source-id: 2c78fe9fa4b6c6b566d9eb01f71e6016d672a545
Summary: Pull Request resolved: pytorch#56392 Fixes for pytorchgh-56371 and pytorchgh-56369 Test Plan: Imported from OSS Reviewed By: H-Huang Differential Revision: D27913212 Pulled By: mruberry fbshipit-source-id: 2c78fe9fa4b6c6b566d9eb01f71e6016d672a545
Summary: Pull Request resolved: pytorch#56392 Fixes for pytorchgh-56371 and pytorchgh-56369 Test Plan: Imported from OSS Reviewed By: H-Huang Differential Revision: D27913212 Pulled By: mruberry fbshipit-source-id: 2c78fe9fa4b6c6b566d9eb01f71e6016d672a545
Stack from ghstack:
Fixes for gh-56371 and gh-56369
Differential Revision: D27913212
Note:
The following requests about testing listed here
#50937 (comment) - see modern COO testing
#50937 (comment) - avoid using numpy
#50937 (comment) - inefficient CSR samples
are being solved in this PR