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

[PyTorch Deprecation] Tensor.storage() has been deprecated #5104

Closed
1 of 2 tasks
yaox12 opened this issue Jan 5, 2023 · 4 comments
Closed
1 of 2 tasks

[PyTorch Deprecation] Tensor.storage() has been deprecated #5104

yaox12 opened this issue Jan 5, 2023 · 4 comments
Assignees
Labels
feature request Feature request topic: python api Issues related to Python APIs

Comments

@yaox12
Copy link
Collaborator

yaox12 commented Jan 5, 2023

Description

Tensor.storage() has been deprecated in PyTorch master and this change would be shipped with PyT 2.0. We may need to update the code calling Tensor.storage() in DGL, because it will raise a warning and finally cause an error.

Note that Tensor._storage() has been renamed to Tensor.untyped_storage() in pytorch/pytorch#91414, which makes it difficult to use a consistent API among PyTorch versions DGL's supporting.

To Do

@jermainewang
Copy link
Member

@peizhou001 Could you take a look? We should first locate where in DGL are we using Tensor.storage().

@github-actions
Copy link

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

@yaox12
Copy link
Collaborator Author

yaox12 commented Apr 21, 2023

DGL is using Tensor.storage() in two places:

  1. in zerocopy_to_dgl_ndarray_for_write, which is easy to fix
    assert input.numel() == input.storage().size(), (
  2. in InvertibleCheckpoint, which I'm not familiar with. Can you take a look to see if there's a workaround? @mufeili
    inputs[1].storage().resize_(0)

@Rhett-Ying
Copy link
Collaborator

close as fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request topic: python api Issues related to Python APIs
Projects
Status: Done
Development

No branches or pull requests

5 participants