Skip to content

Conversation

@pearu
Copy link
Collaborator

@pearu pearu commented Jan 12, 2023

This PR is a copy of #90849 that merge was reverted.

The PR adds "check sparse tensor invariants" flag to Context that when enabled will trigger sparse tensor data invariants checks in unsafe methods of constructing sparse COO/CSR/CSC/BSR/BSC tensors. The feature includes the following changes to UI:

torch.sparse.check_sparse_tensor_invariants class provides different ways to enable/disable the invariant checking.

torch.sparse_coo/csr/csc/bsr/bsc/compressed_tensor functions have a new optional argument check_invariants to enable/disable the invariant checks explicitly. When the check_invariants argument is specified, the global state of the feature is temporarily overridden.

The PR fixes #90833

Stack from ghstack (oldest at bottom):

cc @alexsamardzic @nikitaved @cpuhrsch @amjames @bhosmer

@pearu pearu requested review from a team, albanD and soulitzer as code owners January 12, 2023 19:00
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 12, 2023

🔗 Helpful Links

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

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

✅ No Failures

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

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

@pytorch-bot pytorch-bot bot added the release notes: sparse release notes category label Jan 12, 2023
pearu added a commit that referenced this pull request Jan 12, 2023
@pearu pearu added the module: sparse Related to torch.sparse label Jan 12, 2023
@pearu pearu self-assigned this Jan 12, 2023
@pearu pearu requested a review from cpuhrsch January 12, 2023 19:08
@albanD albanD removed their request for review January 12, 2023 19:23
@pearu
Copy link
Collaborator Author

pearu commented Jan 13, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 13, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@facebook-github-bot facebook-github-bot deleted the gh/pearu/87/head branch June 8, 2023 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged module: sparse Related to torch.sparse open source release notes: sparse release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants