-
Notifications
You must be signed in to change notification settings - Fork 22.1k
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
Add docstring for saved tensors default hooks #62361
Conversation
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 7fb7f68 (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis 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. |
592cc9f
to
7eb7fb1
Compare
7eb7fb1
to
f27bff3
Compare
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Differential Revision: [D29990129](https://our.internmc.facebook.com/intern/diff/D29990129) [ghstack-poisoned]
8eab06b
to
8bdfcef
Compare
@Varal7 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
r"""Sets a pair of pack / unpack hooks for saved tensors. | ||
|
||
Use these hooks to define how intermediary results of an operation | ||
should be packed before saving, and unpacked on retrieval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is where I would add a link to #62362 which defines the terms packing
and unpacking
.
Summary: Pull Request resolved: #62410 This PR adds docstrings for CPU hooks introduced in #61928. Also uncomments the warning about pinned memory in CUDA semantics docs. Depends on: #62361. For now docstrings are an orphan page at https://docs-preview.pytorch.org/62410/generated/torch.autograd.graph.set_save_on_cpu_hooks.html#torch-autograd-graph-set-save-on-cpu-hooks Test Plan: Imported from OSS Reviewed By: soulitzer Differential Revision: D29990129 Pulled By: Varal7 fbshipit-source-id: 7a98eeee6a0abb11e2c2d9169cd1aa35ad7ba3f4
8bdfcef
to
b996540
Compare
b8c1b9d
to
1d4fe7e
Compare
0edb371
to
9d174ec
Compare
9d174ec
to
88d5838
Compare
Somehow autodoc can't find the `graph` module if it's imported with an alias. https://www.internalfb.com/intern/opensource/ci/job/log/265181241677988/ Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 2a115fdb9e1d6d5537b7015b19739ee11efa497b Pull Request resolved: #62923
88d5838
to
61655e6
Compare
torch._C._autograd._reset_default_hooks() | ||
|
||
|
||
class save_on_cpu(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you might be able to implement save_on_cpu
in terms of saved_tensors_hooks
but it doesn't save too many LOC
ghstack-source-id: d316e4f5419428eabe4086aad1be6b597a2c9f24 Pull Request resolved: #62924
61655e6
to
7fb7f68
Compare
@Varal7 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Add documentation for the saved tensors default hooks introduced in #61834 / #62563 Sister PR: #62362 (will add a link from autograd.rst to notes/autograd in whatever PR does not land first) Pull Request resolved: #62361 Reviewed By: zou3519 Differential Revision: D30081997 Pulled By: Varal7 fbshipit-source-id: cb923e943e1d96db9669c1d863d693af30910c62
Summary: Add section to the Autograd mechanics docs to describe the recently exposed saved tensors (#52451), how to register packing / unpacking hooks (#60975) and how to use default hooks (#61834) Sister PR: #62361 (will add a link from autograd.rst to notes/autograd in whatever PR does not land first) Pull Request resolved: #62362 Reviewed By: soulitzer Differential Revision: D30453177 Pulled By: Varal7 fbshipit-source-id: f5759977b069ff0ef36a47b08856d297691a6caa
Add documentation for the saved tensors default hooks introduced in #61834 / #62563
Sister PR: #62362 (will add a link from autograd.rst to notes/autograd in whatever PR does not land first)