Skip to content

Commit 96fa796

Browse files
authored
Merge pull request pytorch#362 from pytorch/1.5_siteupdates
1.5 site updates
2 parents f356861 + ab0028a commit 96fa796

14 files changed

+226
-18
lines changed

_features/cloud-partners.md renamed to _features/cloud-support.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Cloud Partners
3-
order: 7
2+
title: Cloud Support
3+
order: 8
44
snippet: >
55
```sh
66
export IMAGE_FAMILY="pytorch-latest-cpu"

_features/cplusplus-front-end.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: C++ Front-End
3-
order: 6
3+
order: 7
44
snippet: >
55
```cpp
66
#include <torch/torch.h>

_features/distributed-training.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Distributed Training
3-
order: 2
3+
order: 3
44
snippet: >
55
```python
66
import torch.distributed as dist

_features/mobile.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Mobile (Experimental)
3-
order: 3
3+
order: 4
44
snippet: >
55
```python
66
## Save your model

_features/native-onnx-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Native ONNX Support
3-
order: 5
3+
order: 6
44
snippet: >
55
```python
66
import torch.onnx

_features/hybrid-front-end.md renamed to _features/production-ready.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: TorchScript
2+
title: Production Ready
33
order: 1
44
snippet: >
55
```python
@@ -24,7 +24,7 @@ snippet: >
2424
my_script_module.save("my_script_module.pt")
2525
```
2626
27-
summary-home: TorchScript provides a seamless transition between eager mode and graph mode to accelerate the path to production.
27+
summary-home: Transition seamlessly between eager and graph modes with TorchScript, and accelerate the path to production with TorchServe.
2828
featured-home: true
2929

3030
---

_features/tools-libraries.md renamed to _features/robust-ecosystem.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Tools & Libraries
3-
order: 4
2+
title: Robust Ecosystem
3+
order: 5
44
snippet: >
55
```python
66
import torchvision.models as models

_features/torchserve.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: TorchServe (Experimental)
3+
order: 2
4+
snippet: >
5+
```python
6+
## Convert the model from PyTorch to TorchServe format
7+
torch-model-archiver --model-name densenet161 \
8+
--version 1.0 --model-file serve/examples/image_classifier/densenet_161/model.py \
9+
--serialized-file densenet161-8d451a50.pth \
10+
--extra-files serve/examples/image_classifier/index_to_name.json \
11+
--handler image_classifier
12+
13+
## Host your PyTorch model
14+
15+
torchserve --start --model-store model_store --models densenet161=densenet161.mar
16+
```
17+
18+
summary-home: TorchServe is an easy to use tool for deploying PyTorch models at scale. It is cloud and environment agnostic and supports features such as multi-model serving, logging, metrics and the creation of RESTful endpoints for application integration.
19+
featured-home: false
20+
21+
---
22+
23+
TorchServe is an easy to use tool for deploying PyTorch models at scale. It is cloud and environment agnostic and supports features such as multi-model serving, logging, metrics and the creation of RESTful endpoints for application integration.

_includes/quick_start_cloud_options.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
</div>
1818

1919
<ul>
20-
<li><a href="https://aws.amazon.com/pytorch/">Amazon SageMaker</a></li>
21-
<li><a href="https://aws.amazon.com/pytorch/">AWS Deep Learning AMIs</a></li>
20+
<li><a href="https://aws.amazon.com/pytorch/">PyTorch on AWS</a></li>
21+
<li><a href="https://sagemaker.readthedocs.io/en/stable/using_pytorch.html">Amazon SageMaker</a></li>
22+
<li><a href="https://docs.aws.amazon.com/deep-learning-containers/latest/devguide/deep-learning-containers-ec2-tutorials-training.html#deep-learning-containers-ec2-tutorials-training-pytorch">AWS Deep Learning Containers</a></li>
23+
<li><a href="https://docs.aws.amazon.com/dlami/latest/devguide/tutorial-pytorch.html">AWS Deep Learning AMIs</a></li>
2224
</ul>
2325
</div>
2426
</div>

_news/news-item-1.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
order: 1
3-
link: https://pytorch.org/blog/pytorch-1-dot-4-released-and-domain-libraries-updated/
4-
summary: PyTorch 1.4 is now available - adds ability to do fine grain build level customization for PyTorch Mobile, updated domain libraries, and new experimental features.
3+
link: https://pytorch.org/blog/pytorch-1-dot-5-released-with-new-and-updated-apis
4+
summary: PyTorch 1.5 released, new and updated APIs including C++ frontend API parity with Python.
55
---
66

77

_news/news-item-2.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
order: 2
3-
link: https://pytorch.org/blog/pytorch-adds-new-tools-and-libraries-welcomes-preferred-networks-to-its-community/
4-
summary: PyTorch adds new tools and libraries, welcomes Preferred Networks to its community.
3+
link: https://pytorch.org/blog/pytorch-library-updates-new-model-serving-library
4+
summary: PyTorch library updates including new model serving library
55
---
66

7+

_news/news-item-3.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
order: 3
3-
link: https://pytorch.org/blog/openmined-and-pytorch-launch-fellowship-funding-for-privacy-preserving-ml/
4-
summary: OpenMined and PyTorch partner to launch fellowship funding for privacy-preserving ML community.
3+
link: https://pytorch.org/blog/pytorch-1-dot-4-released-and-domain-libraries-updated/
4+
summary: PyTorch 1.4 is now available - adds ability to do fine grain build level customization for PyTorch Mobile, updated domain libraries, and new experimental features.
55
---
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
layout: blog_detail
3+
title: 'PyTorch 1.5 released, new and updated APIs including C++ frontend API parity with Python'
4+
author: Team PyTorch
5+
---
6+
7+
8+
Today, we’re announcing the availability of PyTorch 1.5, along with new and updated libraries. This release includes several major new API additions and improvements. PyTorch now includes a significant update to the C++ frontend, ‘channels last’ memory format for computer vision models, and a stable release of the distributed RPC framework used for model-parallel training. The release also has new APIs for autograd for hessians and jacobians, and an API that allows the creation of Custom C++ Classes that was inspired by pybind.
9+
10+
You can find the detailed release notes [here](https://github.com/pytorch/pytorch/releases).
11+
12+
## C++ Frontend API (Stable)
13+
14+
The C++ frontend API is now at parity with Python, and the features overall have been moved to ‘stable’ (previously tagged as experimental). Some of the major highlights include:
15+
16+
* Now with ~100% coverage and docs for C++ torch::nn module/functional, users can easily translate their model from Python API to C++ API, making the model authoring experience much smoother.
17+
* Optimizers in C++ had deviated from the Python equivalent: C++ optimizers can’t take parameter groups as input while the Python ones can. Additionally, step function implementations were not exactly the same. With the 1.5 release, C++ optimizers will always behave the same as the Python equivalent.
18+
* The lack of tensor multi-dim indexing API in C++ is a well-known issue and had resulted in many posts in PyTorch Github issue tracker and forum. The previous workaround was to use a combination of `narrow` / `select` / `index_select` / `masked_select`, which was clunky and error-prone compared to the Python API’s elegant `tensor[:, 0, ..., mask]` syntax. With the 1.5 release, users can use `tensor.index({Slice(), 0, "...", mask})` to achieve the same purpose.
19+
20+
## ‘Channels last’ memory format for Computer Vision models (Experimental)
21+
22+
‘Channels last’ memory layout unlocks ability to use performance efficient convolution algorithms and hardware (NVIDIA’s Tensor Cores, FBGEMM, QNNPACK). Additionally, it is designed to automatically propagate through the operators, which allows easy switching between memory layouts.
23+
24+
Learn more [here](https://github.com/pytorch/pytorch/wiki/Writing-memory-format-aware-operators) on how to write memory format aware operators.
25+
26+
## Custom C++ Classes (Experimental)
27+
28+
This release adds a new API, `torch.CutomClassHolder`, for binding custom C++ classes into TorchScript and Python simultaneously. This API is almost identical in syntax to [pybind11](https://pybind11.readthedocs.io/en/stable/). It allows users to expose their C++ class and its methods to the TorchScript type system and runtime system such that they can instantiate and manipulate arbitrary C++ objects from TorchScript and Python. An example C++ binding:
29+
30+
```python
31+
template <class T>
32+
struct Stack : torch::CustomClassHolder {
33+
std::vector<T> stack_;
34+
Stack(std::vector<T> init) : stack_(std::move(init)) {}
35+
36+
void push(T x) {
37+
stack_.push_back(x);
38+
}
39+
T pop() {
40+
auto val = stack_.back();
41+
stack_.pop_back();
42+
return val;
43+
}
44+
};
45+
46+
static auto testStack =
47+
torch::class_<Stack<std::string>>("Stack")
48+
.def(torch::init<std::vector<std::string>>())
49+
.def("push", &Stack<std::string>::push)
50+
.def("pop", &Stack<std::string>::pop)
51+
.def("size", [](const c10::intrusive_ptr<Stack>& self) {
52+
return self->stack_.size();
53+
});
54+
```
55+
56+
Which exposes a class you can use in Python and TorchScript like so:
57+
58+
```python
59+
@torch.jit.script
60+
def do_stacks(s : torch.classes.Stack):
61+
s2 = torch.classes.Stack(["hi", "mom"])
62+
print(s2.pop()) # "mom"
63+
s2.push("foobar")
64+
return s2 # ["hi", "foobar"]
65+
```
66+
67+
You can try it out in the tutorial [here](https://pytorch.org/tutorials/recipes/recipes/torsh_script_custom_classes.html).
68+
69+
## Distributed RPC framework APIs (Now Stable)
70+
71+
The Distributed [RPC framework](https://pytorch.org/docs/stable/rpc.html) was launched as experimental in the 1.4 release and the proposal is to mark Distributed RPC framework as stable and no longer experimental. This work involves a lot of enhancements and bug fixes to make the distributed RPC framework more reliable and robust overall, as well as adding a couple of new features, including profiling support, using TorchScript functions in RPC, and several enhancements for ease of use. Below is an overview of the various APIs within the framework:
72+
73+
### RPC API
74+
The RPC API allows users to specify functions to run and objects to be instantiated on remote nodes. These functions are transparently recorded so that gradients can backpropagate through remote needs using Distributed Autograd.
75+
76+
### Distributed Autograd
77+
Distributed Autograd connects the autograd graph across several nodes and allows gradients to flow through during the backwards pass. Gradients are accumulated into a context (as opposed to the .grad field as with Autograd) and users must specify their model’s forward pass under a with `dist_autograd.context()` manager in order to ensure that all RPC communication is recorded properly. Currently, only FAST mode is implemented (see https://pytorch.org/docs/stable/notes/distributed_autograd.html#smart-mode-algorithm for the difference between FAST and SMART modes).
78+
79+
### Distributed Optimizer
80+
The distributed optimizer creates RRefs to optimizers on each worker with parameters that require gradients, and then uses the RPC API to run the optimizer remotely. The user must collect all remote parameters and wrap them in an `RRef`, as this is required input to the distributed optimizer. The user must also specify the distributed autograd `context_id` so that the optimizer knows in which context to look for gradients.
81+
82+
Learn more about distributed RPC framework APIs [here](https://pytorch.org/docs/stable/rpc.html).
83+
84+
## New High level autograd API (Experimental)
85+
86+
PyTorch 1.5 brings new functions including jacobian, hessian, jvp, vjp, hvp and vhp to the `torch.autograd.functional` submodule. This feature builds on the current API and allows the user to easily perform these functions.
87+
88+
Detailed design discussion on GitHub can be found [here](https://github.com/pytorch/pytorch/issues/30632).
89+
90+
## Python 2 no longer supported
91+
92+
Starting PyTorch 1.5.0, we will no longer support Python 2, specifically version 2.7. Going forward support for Python will be limited to Python 3, specifically Python 3.5, 3.6, 3.7 and 3.8 (first enabled in PyTorch 1.4.0).
93+
94+
95+
*We’d like to thank the entire PyTorch team and the community for all their contributions to this work.*
96+
97+
Cheers!
98+
99+
Team PyTorch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
layout: blog_detail
3+
title: 'PyTorch library updates including new model serving library '
4+
author: Team PyTorch
5+
---
6+
7+
8+
Along with the PyTorch 1.5 release, we are announcing new libraries for high-performance PyTorch model serving and tight integration with TorchElastic and Kubernetes. Additionally, we are releasing updated packages for torch_xla (Google Cloud TPUs), torchaudio, torchvision, and torchtext. All of these new libraries and enhanced capabilities are available today and accompany all of the core features [released in PyTorch 1.5](https://pytorch.org/blog/pytorch-1-dot-5-released-with-new-and-updated-apis).
9+
10+
## TorchServe (Experimental)
11+
12+
TorchServe is a flexible and easy to use library for serving PyTorch models in production performantly at scale. It is cloud and environment agnostic and supports features such as multi-model serving, logging, metrics, and the creation of RESTful endpoints for application integration. TorchServe was jointly developed by engineers from Facebook and AWS with feedback and engagement from the broader PyTorch community. The experimental release of TorchServe is available today. Some of the highlights include:
13+
14+
* Support for both Python-based and TorchScript-based models
15+
* Default handlers for common use cases (e.g., image segmentation, text classification) as well as the ability to write custom handlers for other use cases
16+
* Model versioning, the ability to run multiple versions of a model at the same time, and the ability to roll back to an earlier version
17+
* The ability to package a model, learning weights, and supporting files (e.g., class mappings, vocabularies) into a single, persistent artifact (a.k.a. the “model archive”)
18+
* Robust management capability, allowing full configuration of models, versions, and individual worker threads via command line, config file, or run-time API
19+
* Automatic batching of individual inferences across HTTP requests
20+
* Logging including common metrics, and the ability to incorporate custom metrics
21+
* Ready-made Dockerfile for easy deployment
22+
* HTTPS support for secure deployment
23+
24+
To learn more about the APIs and the design of this feature, see the links below:
25+
* See <here> for a full multi-node deployment reference architecture.
26+
* The full documentation can be found [here](https://pytorch.org/serve).
27+
28+
## TorchElastic integration with Kubernetes (Experimental)
29+
30+
[TorchElastic](https://github.com/pytorch/elastic) is a proven library for training large scale deep neural networks at scale within companies like Facebook, where having the ability to dynamically adapt to server availability and scale as new compute resources come online is critical. Kubernetes enables customers using machine learning frameworks like PyTorch to run training jobs distributed across fleets of powerful GPU instances like the Amazon EC2 P3. Distributed training jobs, however, are not fault-tolerant, and a job cannot continue if a node failure or reclamation interrupts training. Further, jobs cannot start without acquiring all required resources, or scale up and down without being restarted. This lack of resiliency and flexibility results in increased training time and costs from idle resources. TorchElastic addresses these limitations by enabling distributed training jobs to be executed in a fault-tolerant and elastic manner. Until today, Kubernetes users needed to manage Pods and Services required for TorchElastic training jobs manually.
31+
32+
Through the joint collaboration of engineers at Facebook and AWS, TorchElastic, adding elasticity and fault tolerance, is now supported using vanilla Kubernetes and through the managed EKS service from AWS.
33+
34+
To learn more see the [TorchElastic repo](http://pytorch.org/elastic/0.2.0rc0/kubernetes.html) for the controller implementation and docs on how to use it.
35+
36+
## torch_xla 1.5 now available
37+
38+
[torch_xla](http://pytorch.org/xla/) is a Python package that uses the [XLA linear algebra compiler](https://www.tensorflow.org/xla) to accelerate the [PyTorch deep learning framework](https://pytorch.org/) on [Cloud TPUs](https://cloud.google.com/tpu/) and [Cloud TPU Pods](https://cloud.google.com/tpu/docs/tutorials/pytorch-pod). torch_xla aims to give PyTorch users the ability to do everything they can do on GPUs on Cloud TPUs as well while minimizing changes to the user experience. The project began with a conversation at NeurIPS 2017 and gathered momentum in 2018 when teams from Facebook and Google came together to create a proof of concept. We announced this collaboration at PTDC 2018 and made the PyTorch/XLA integration broadly available at PTDC 2019. The project already has 28 contributors, nearly 2k commits, and a repo that has been forked more than 100 times.
39+
40+
This release of [torch_xla](http://pytorch.org/xla/) is aligned and tested with PyTorch 1.5 to reduce friction for developers and to provide a stable and mature PyTorch/XLA stack for training models using Cloud TPU hardware. You can [try it for free](https://medium.com/pytorch/get-started-with-pytorch-cloud-tpus-and-colab-a24757b8f7fc) in your browser on an 8-core Cloud TPU device with [Google Colab](https://colab.research.google.com/), and you can use it at a much larger scaleon [Google Cloud](https://cloud.google.com/gcp).
41+
42+
See the full torch_xla release notes [here](https://github.com/pytorch/xla/releases). Full docs and tutorials can be found [here](https://pytorch.org/xla/) and [here](https://cloud.google.com/tpu/docs/tutorials).
43+
44+
## PyTorch Domain Libraries
45+
46+
torchaudio, torchvision, and torchtext complement PyTorch with common datasets, models, and transforms in each domain area. We’re excited to share new releases for all three domain libraries alongside PyTorch 1.5 and the rest of the library updates. For this release, all three domain libraries are removing support for Python2 and will support Python3 only.
47+
48+
### torchaudio 0.5
49+
The torchaudio 0.5 release includes new transforms, functionals, and datasets. Highlights for the release include:
50+
51+
* Added the Griffin-Lim functional and transform, `InverseMelScale` and `Vol` transforms, and `DB_to_amplitude`.
52+
* Added support for `allpass`, `fade`, `bandpass`, `bandreject`, `band`, `treble`, `deemph`, and `riaa` filters and transformations.
53+
* New datasets added including `LJSpeech` and `SpeechCommands` datasets.
54+
55+
See the release full notes [here](https://github.com/pytorch/audio/releases) and full docs can be found [here](https://pytorch.org/audio/).
56+
57+
### torchvision 0.6
58+
The torchvision 0.6 release includes updates to datasets, models and a significant number of bug fixes. Highlights include:
59+
60+
* Faster R-CNN now supports negative samples which allows the feeding of images without annotations at training time.
61+
* Added `aligned` flag to `RoIAlign` to match Detectron2.
62+
* Refactored abstractions for C++ video decoder
63+
64+
See the release full notes [here](https://github.com/pytorch/vision/releases) and full docs can be found [here](https://pytorch.org/docs/stable/torchvision/index.html).
65+
66+
### torchtext 0.6
67+
The torchtext 0.6 release includes a number of bug fixes and improvements to documentation. Based on user's feedback, dataset abstractions are currently being redesigned also. Highlights for the release include:
68+
69+
* Fixed an issue related to the SentencePiece dependency in conda package.
70+
* Added support for the experimental IMDB dataset to allow a custom vocab.
71+
* A number of documentation updates including adding a code of conduct and a deduplication of the docs on the torchtext site.
72+
73+
Your feedback and discussions on the experimental datasets API are welcomed. You can send them to [issue #664](https://github.com/pytorch/text/issues/664). We would also like to highlight the pull request [here](https://github.com/pytorch/text/pull/701) where the latest dataset abstraction is applied to the text classification datasets. The feedback can be beneficial to finalizing this abstraction.
74+
75+
See the release full notes [here](https://github.com/pytorch/text/releases) and full docs can be found [here](https://pytorch.org/text/).
76+
77+
78+
*We’d like to thank the entire PyTorch team, the Amazon team and the community for all their contributions to this work.*
79+
80+
Cheers!
81+
82+
Team PyTorch

0 commit comments

Comments
 (0)