Commit Graph

8 Commits

Author SHA1 Message Date
3a0d088517 Flip default value for mypy disallow_untyped_defs [5/11] (#127842)
See #127836 for details.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127842
Approved by: https://github.com/oulgen
2024-06-08 18:49:18 +00:00
e5b9d98752 Rephrase zero_grad docs (#95643)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/95643
Approved by: https://github.com/albanD
2023-02-28 22:04:23 +00:00
b90496eef5 [nn] zero_grad() set_to_none default True (#92731)
Attempts to fix #92656

BC-breaking! This changes the default of zero_grad in optim and in nn to default set grads to None instead of zero tensors. We are changing the default because there are proven perf wins and existing code has typically not regressed due to this change. (will probably have to flesh out this note more).

Pull Request resolved: https://github.com/pytorch/pytorch/pull/92731
Approved by: https://github.com/ngimel
2023-01-26 01:04:28 +00:00
71d50f4f89 Change docstring type callable to Callable for consistency (#82487)
### Description

Across PyTorch's docstrings, both `callable` and `Callable` for variable types. The Callable should be capitalized as we are referring to the `Callable` type, and not the Python `callable()` function.

### Testing

There shouldn't be any testing required.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/82487
Approved by: https://github.com/albanD
2022-08-01 17:26:09 +00:00
7ff121e75a [reland] make ShardedTensor be a Tensor and nn.Parameter (#82089)
This is the reland PR of https://github.com/pytorch/pytorch/pull/79825,
which was reverted due to multi-gpu ci failures. Fixes those failures
and reland it again.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82089
Approved by: https://github.com/fduwjj
2022-07-25 19:06:01 +00:00
f51cf774c6 Revert "[_shard] make ShardedTensor be a Tensor and nn.Parameter (#79825)"
This reverts commit 9c32439a770845793107a584f17f4da70ccb5df0.

Reverted https://github.com/pytorch/pytorch/pull/79825 on behalf of https://github.com/janeyx99 due to Sorry, reverting for breaking multigpu tests 9c32439a77
2022-07-22 20:39:44 +00:00
9c32439a77 [_shard] make ShardedTensor be a Tensor and nn.Parameter (#79825)
Differential Revision: [D37707371](https://our.internmc.facebook.com/intern/diff/D37707371)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79825
Approved by: https://github.com/kumpera
2022-07-22 16:50:12 +00:00
64670e414e [reland] Create torch.distributed._shard package. (#72141)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72141

We have many sharding components currently:
torch.distributed._sharded_tensor, torch.distributed._sharding_spec,
torch.distributed._sharded_optimizer and more coming.

As a result, organizing all of this under the `torch.distributed._shard`
package. For BC reasons, I'm still keeping the old packages and have them just
reference the new package.
ghstack-source-id: 148150861
ghstack-source-id: 148150861

Test Plan: waitforbuildbot

Reviewed By: fduwjj

Differential Revision: D33904585

fbshipit-source-id: 057e847eb7521b536a3ee4e0f94871aacc752062
(cherry picked from commit 29a70dd7afde6083bab942081020a13278f38e52)
2022-02-02 06:58:20 +00:00