Skip to content

Conversation

@anjali411
Copy link
Contributor

@anjali411 anjali411 commented Sep 17, 2021

Stack from ghstack:

  1. Updated the legacy type checks in torch/csrc/autograd/engine.cpp to individually validate the dtype, device, and layout equality for grad and tensor.
  2. Removed device field from InputMetadata since it's already stored via storing options. Also, added dtype() and layout() methods to InputMetadata. To make this change, some calls had to be updated due to the change in constructor.
  3. To fix Fix autograd engine checks #65016:
    a. Added a is_tensor_subclass field in InputMetadata to skip device checks for grad and tensor when the tensor has
    python key set on it (tensor subclass).

Differential Revision: D31117318

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Sep 17, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit 1fe42fd (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-scanned failure(s)

ci.pytorch.org: 1 failed


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.

Click here to manually regenerate this comment.

anjali411 added a commit that referenced this pull request Sep 17, 2021
ghstack-source-id: 5620264
Pull Request resolved: #65235
@anjali411 anjali411 requested a review from ezyang September 17, 2021 20:29
@ezyang ezyang removed their request for review September 20, 2021 13:44
@ezyang
Copy link
Contributor

ezyang commented Sep 20, 2021

I'm letting Alban do full review on this.

1. Updated the legacy type checks in `torch/csrc/autograd/engine.cpp` to individually validate the dtype, device, and layout equality for grad and tensor.
2. Removed device field from `InputMetadata` since it's already stored via storing options. Also, added `dtype()` and `layout()` methods to `InputMetadata`. To make this change, some calls had to be updated due to the change in constructor.
3. To fix #65016:
     a. Added a `is_tensor_subclass` field in `InputMetadata` to skip device checks for grad and tensor when the tensor has 
         python key set on it (tensor subclass).

[ghstack-poisoned]
@anjali411 anjali411 requested a review from albanD September 20, 2021 17:21
1. Updated the legacy type checks in `torch/csrc/autograd/engine.cpp` to individually validate the dtype, device, and layout equality for grad and tensor.
2. Removed device field from `InputMetadata` since it's already stored via storing options. Also, added `dtype()` and `layout()` methods to `InputMetadata`. To make this change, some calls had to be updated due to the change in constructor.
3. To fix #65016:
     a. Added a `is_tensor_subclass` field in `InputMetadata` to skip device checks for grad and tensor when the tensor has 
         python key set on it (tensor subclass).

[ghstack-poisoned]
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

sgtm just the continue thing

@anjali411 anjali411 requested a review from albanD September 20, 2021 19:27
1. Updated the legacy type checks in `torch/csrc/autograd/engine.cpp` to individually validate the dtype, device, and layout equality for grad and tensor.
2. Removed device field from `InputMetadata` since it's already stored via storing options. Also, added `dtype()` and `layout()` methods to `InputMetadata`. To make this change, some calls had to be updated due to the change in constructor.
3. To fix #65016:
     a. Added a `is_tensor_subclass` field in `InputMetadata` to skip device checks for grad and tensor when the tensor has 
         python key set on it (tensor subclass).

[ghstack-poisoned]
anjali411 added a commit that referenced this pull request Sep 20, 2021
ghstack-source-id: 0e0cb66
Pull Request resolved: #65235
@anjali411
Copy link
Contributor Author

@anjali411 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Sounds good!

1. Updated the legacy type checks in `torch/csrc/autograd/engine.cpp` to individually validate the dtype, device, and layout equality for grad and tensor.
2. Removed device field from `InputMetadata` since it's already stored via storing options. Also, added `dtype()` and `layout()` methods to `InputMetadata`. To make this change, some calls had to be updated due to the change in constructor.
3. To fix #65016:
     a. Added a `is_tensor_subclass` field in `InputMetadata` to skip device checks for grad and tensor when the tensor has 
         python key set on it (tensor subclass).

Differential Revision: [D31082693](https://our.internmc.facebook.com/intern/diff/D31082693)

[ghstack-poisoned]
anjali411 added a commit that referenced this pull request Sep 21, 2021
ghstack-source-id: 003d067
Pull Request resolved: #65235
@anjali411
Copy link
Contributor Author

@anjali411 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@anjali411 merged this pull request in 9324d68.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 152f023.

1. Updated the legacy type checks in `torch/csrc/autograd/engine.cpp` to individually validate the dtype, device, and layout equality for grad and tensor.
2. Removed device field from `InputMetadata` since it's already stored via storing options. Also, added `dtype()` and `layout()` methods to `InputMetadata`. To make this change, some calls had to be updated due to the change in constructor.
3. To fix #65016:
     a. Added a `is_tensor_subclass` field in `InputMetadata` to skip device checks for grad and tensor when the tensor has 
         python key set on it (tensor subclass).

Differential Revision: [D31082693](https://our.internmc.facebook.com/intern/diff/D31082693)

[ghstack-poisoned]
anjali411 added a commit that referenced this pull request Sep 22, 2021
ghstack-source-id: b0cbca0
Pull Request resolved: #65235
@anjali411
Copy link
Contributor Author

@anjali411 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@anjali411
Copy link
Contributor Author

@ezyang @albanD should we cherry-pick this in 1.10?

@albanD
Copy link
Collaborator

albanD commented Sep 22, 2021

I would say no since I don't think we plan to have broad subclassing support in 1.10 anyways?

@facebook-github-bot facebook-github-bot deleted the gh/anjali411/137/head branch September 26, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants