Skip to content
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

Fix a bug in nesting check_sparse_tensor_invariants context managers #95372

Closed
wants to merge 1 commit into from

Conversation

pearu
Copy link
Collaborator

@pearu pearu commented Feb 23, 2023

As in the title. The bug was reported in #94728 (comment) and has the following reproducer:

>>> import torch
>>> check_ctx = torch.sparse.check_sparse_tensor_invariants(True)
>>> no_check_ctx = torch.sparse.check_sparse_tensor_invariants(False)
>>> with check_ctx:
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   with no_check_ctx:
...     assert not torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
... 
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
AssertionError

Stack from ghstack (oldest at bottom):

cc @alexsamardzic @nikitaved @cpuhrsch @amjames @bhosmer

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 23, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit e13c4fb:
💚 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 Feb 23, 2023
@pearu pearu self-assigned this Feb 23, 2023
@pearu pearu added module: sparse Related to torch.sparse topic: bug fixes topic category labels Feb 23, 2023
@pearu pearu added this to In progress in Sparse tensors via automation Feb 23, 2023
Sparse tensors automation moved this from In progress to Reviewer approved Feb 23, 2023
@pearu
Copy link
Collaborator Author

pearu commented Feb 23, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 23, 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

Sparse tensors automation moved this from Reviewer approved to Done Feb 23, 2023
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 25, 2023
…(#95372)

As in the title. The bug was reported in pytorch/pytorch#94728 (comment) and has the following reproducer:
```python
>>> import torch
>>> check_ctx = torch.sparse.check_sparse_tensor_invariants(True)
>>> no_check_ctx = torch.sparse.check_sparse_tensor_invariants(False)
>>> with check_ctx:
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   with no_check_ctx:
...     assert not torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
AssertionError
```

Pull Request resolved: pytorch/pytorch#95372
Approved by: https://github.com/cpuhrsch
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 25, 2023
…(#95372)

As in the title. The bug was reported in pytorch/pytorch#94728 (comment) and has the following reproducer:
```python
>>> import torch
>>> check_ctx = torch.sparse.check_sparse_tensor_invariants(True)
>>> no_check_ctx = torch.sparse.check_sparse_tensor_invariants(False)
>>> with check_ctx:
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   with no_check_ctx:
...     assert not torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
AssertionError
```

Pull Request resolved: pytorch/pytorch#95372
Approved by: https://github.com/cpuhrsch
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 5, 2023
…(#95372)

As in the title. The bug was reported in pytorch/pytorch#94728 (comment) and has the following reproducer:
```python
>>> import torch
>>> check_ctx = torch.sparse.check_sparse_tensor_invariants(True)
>>> no_check_ctx = torch.sparse.check_sparse_tensor_invariants(False)
>>> with check_ctx:
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   with no_check_ctx:
...     assert not torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
AssertionError
```

Pull Request resolved: pytorch/pytorch#95372
Approved by: https://github.com/cpuhrsch
pruthvistony added a commit to ROCm/pytorch that referenced this pull request May 2, 2023
@facebook-github-bot facebook-github-bot deleted the gh/pearu/93/head branch June 8, 2023 18:18
jhavukainen pushed a commit to kulinseth/pytorch that referenced this pull request Mar 15, 2024
…ytorch#95372)

As in the title. The bug was reported in pytorch#94728 (comment) and has the following reproducer:
```python
>>> import torch
>>> check_ctx = torch.sparse.check_sparse_tensor_invariants(True)
>>> no_check_ctx = torch.sparse.check_sparse_tensor_invariants(False)
>>> with check_ctx:
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   with no_check_ctx:
...     assert not torch.sparse.check_sparse_tensor_invariants.is_enabled()
...   assert torch.sparse.check_sparse_tensor_invariants.is_enabled()
...
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
AssertionError
```

Pull Request resolved: pytorch#95372
Approved by: https://github.com/cpuhrsch
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 topic: bug fixes topic category
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants