Skip to content

Conversation

pearu
Copy link
Collaborator

@pearu pearu commented May 1, 2023

This PR enables sum tests for sparse sample inputs. Previously, the tests existed but were never run because the sum OpInfo instance was created without specifying supports_sparse_*=True. To avoid such mistakes in the future, the following PR #100392 enables the supports_sparse_* flags automatically when OpInfo creation specifies sample_inputs_sparse_*_func.

In addition, the PR applies several fixes to sum tests for sparse sample inputs.

Stack from ghstack (oldest at bottom):

cc @alexsamardzic @nikitaved @cpuhrsch @amjames @bhosmer

@pearu pearu requested review from mruberry and ngimel as code owners May 1, 2023 16:27
@pytorch-bot
Copy link

pytorch-bot bot commented May 1, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/100391

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 45bf2d5:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

cc alexsamardzic nikitaved cpuhrsch amjames bhosmer

[ghstack-poisoned]
@pearu pearu requested a review from pmeier May 2, 2023 14:52
This PR enables sum tests for sparse sample inputs. Previously, the tests existed but were never run because the sum OpInfo instance was created without specifying `supports_sparse_*=True`. To avoid such mistakes in the future, the following PR #100392 enables the `supports_sparse_*` flags automatically when OpInfo creation specifies `sample_inputs_sparse_*_func`.

In addition, the PR applies several fixes to sum tests for sparse sample inputs.




cc alexsamardzic nikitaved cpuhrsch amjames bhosmer

[ghstack-poisoned]
pearu added a commit that referenced this pull request May 2, 2023
…ction implies the corresponding layout support"

As in the title.

The PR fixes an issue of silently skipping tests as described in #100391.




[ghstack-poisoned]
pearu added a commit that referenced this pull request May 2, 2023
…e corresponding layout support"

As in the title.

The PR fixes an issue of silently skipping tests as described in #100391.




[ghstack-poisoned]
@cpuhrsch cpuhrsch changed the title Enable sum tests with sparse sample inputs. Fix sum OpInfo for sparse sample inputs and assert coverage for sparse-enabled operators May 2, 2023
Copy link
Contributor

@cpuhrsch cpuhrsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the title to better reflect what this achieves.

This is great! Hopefully this way if an operation that's part of OpInfo supports sparse inputs we will have it covered. Good steps towards making sure we'll reach stability.

pytorchmergebot pushed a commit that referenced this pull request May 3, 2023
…ding layout support (#100392)

As in the title.

The PR fixes an issue of silently skipping tests as described in #100391.

Pull Request resolved: #100392
Approved by: https://github.com/pmeier, https://github.com/cpuhrsch
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jun 2, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
@facebook-github-bot facebook-github-bot deleted the gh/pearu/101/head branch June 8, 2023 18:16
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jun 15, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jun 18, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jun 25, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
pytorchmergebot pushed a commit to yanbing-j/pytorch that referenced this pull request Jul 3, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
pytorchmergebot pushed a commit to yanbing-j/pytorch that referenced this pull request Jul 4, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
pytorchmergebot pushed a commit to yanbing-j/pytorch that referenced this pull request Jul 6, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jul 15, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jul 16, 2023
The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jul 19, 2023
Simplify the dispatch

Add UT

Fix the bug of index_type in reduce_sparse_csr_dim0_cpu_template

Use opmath_t as reduction type

Fix CI failures

The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.

Remove the change in test_sparse_csr.py

Remove AT_DISPATCH_INDEX_TYPES based on comments

Remove to(torch.int64) explicitly and change input data type to torch.int64

Support integral return value in reduce_sparse_csr_cpu_template

Refactor according to comments

Abstract to_type in sparse_csr

Update based on comments
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jul 21, 2023
Simplify the dispatch

Add UT

Fix the bug of index_type in reduce_sparse_csr_dim0_cpu_template

Use opmath_t as reduction type

Fix CI failures

The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.

Remove the change in test_sparse_csr.py

Remove AT_DISPATCH_INDEX_TYPES based on comments

Remove to(torch.int64) explicitly and change input data type to torch.int64

Support integral return value in reduce_sparse_csr_cpu_template

Refactor according to comments

Abstract to_type in sparse_csr

Update based on comments
yanbing-j added a commit to yanbing-j/pytorch that referenced this pull request Jul 23, 2023
Simplify the dispatch

Add UT

Fix the bug of index_type in reduce_sparse_csr_dim0_cpu_template

Use opmath_t as reduction type

Fix CI failures

The failures are from:
1. SparseCsrCPU includes csc, bsr, bsc, except for csr. csr is only supported
for now, csc can be easily converted to csr, while bsr and bsc are not.
2. This PR has conflict with pytorch#100391.

Remove the change in test_sparse_csr.py

Remove AT_DISPATCH_INDEX_TYPES based on comments

Remove to(torch.int64) explicitly and change input data type to torch.int64

Support integral return value in reduce_sparse_csr_cpu_template

Refactor according to comments

Abstract to_type in sparse_csr

Update based on comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: sparse Related to torch.sparse module: testing Issues related to the torch.testing module (not tests) open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants