Skip to content

Commit 56370d8

Browse files
committed
1 parent b89e4fb commit 56370d8

29 files changed

+372
-88
lines changed

โ€ŽGemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ GEM
211211
rb-fsevent (~> 0.10, >= 0.10.3)
212212
rb-inotify (~> 0.9, >= 0.9.10)
213213
mercenary (0.3.6)
214-
mini_portile2 (2.5.0)
214+
mini_portile2 (2.5.1)
215215
minima (2.5.1)
216216
jekyll (>= 3.5, < 5.0)
217217
jekyll-feed (~> 0.9)
218218
jekyll-seo-tag (~> 2.1)
219219
minitest (5.14.4)
220220
multipart-post (2.1.1)
221-
nokogiri (1.11.2)
221+
nokogiri (1.11.4)
222222
mini_portile2 (~> 2.5.0)
223223
racc (~> 1.4)
224224
octokit (4.20.0)

โ€Ž_about/website.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ snippet: >
1414

1515
ํŒŒ์ดํ† ์น˜ ํ•œ๊ตญ ์‚ฌ์šฉ์ž ๋ชจ์ž„์€ 2018๋…„ ์ค‘์ˆœ, ํ•™์Šต์„ ๋ชฉ์ ์œผ๋กœ PyTorch ํŠœํ† ๋ฆฌ์–ผ ๋ฌธ์„œ๋ฅผ ํ•œ๊ตญ์–ด๋กœ ๋ฒˆ์—ญํ•˜๋ฉด์„œ ์‹œ์ž‘ํ•˜์˜€์Šต๋‹ˆ๋‹ค.<br />
1616

17-
Facebook, Inc์™€ ๊ด€๋ จ์—†๋Š” ๊ฐœ์ธ๋“ค์ด ์‹œ์ž‘ํ•œ ๋น„๊ณต์‹ / ๋น„์˜๋ฆฌ ์‚ฌ์ดํŠธ๋กœ, ํ•œ๊ตญ์–ด๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๋Š” ๋งŽ์€ ๋ถ„๋“ค๊ป˜ PyTorch๋ฅผ ์†Œ๊ฐœํ•˜๊ณ  ํ•จ๊ป˜ ๋ฐฐ์šฐ๋ฉฐ ์„ฑ์žฅํ•˜๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.<br />
17+
PyTorch๋ฅผ ํ•™์Šตํ•˜๊ณ  ์‚ฌ์šฉํ•˜๋Š” PyTorch ํ•œ๊ตญ ์‚ฌ์šฉ์ž๋“ค์ด ์‹œ์ž‘ํ•œ ์‚ฌ์šฉ์ž ์ปค๋ฎค๋‹ˆํ‹ฐ๋กœ, ํ•œ๊ตญ์–ด๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๋Š” ๋งŽ์€ ๋ถ„๋“ค๊ป˜ PyTorch๋ฅผ ์†Œ๊ฐœํ•˜๊ณ  ํ•จ๊ป˜ ๋ฐฐ์šฐ๋ฉฐ ์„ฑ์žฅํ•˜๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.<br />
1818

1919
์ด ํ™ˆํŽ˜์ด์ง€ ๋˜๋Š” ํŠœํ† ๋ฆฌ์–ผ์— ๊ฐœ์„ ์ด ํ•„์š”ํ•œ ๋ถ€๋ถ„์„ ๋ฐœ๊ฒฌํ•˜์…จ๋‹ค๋ฉด <a href="https://github.com/9bow/PyTorchKR" target="_blank">ํ™ˆํŽ˜์ด์ง€ ์ €์žฅ์†Œ</a> ๋˜๋Š” <a href="https://github.com/9bow/PyTorch-tutorials-kr" target="_blank">ํŠœํ† ๋ฆฌ์–ผ ์ €์žฅ์†Œ</a>์— ์ด์Šˆ ๋˜๋Š” PR์„ ๋‚จ๊ฒจ์ฃผ์„ธ์š”.

โ€Ž_features/torchserve.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: TorchServe (Experimental)
2+
title: TorchServe
33
order: 2
44
snippet: >
55
```python

โ€Ž_get_started/installation/azure.md

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ Azure [provides](https://azure.microsoft.com/en-us/services/machine-learning-ser
99
* dedicated, pre-built [machine learning virtual machines](https://azure.microsoft.com/en-us/services/virtual-machines/data-science-virtual-machines/){:target="_blank"}, complete with PyTorch.
1010
* bare Linux and Windows virtual machines for you to do a custom install of PyTorch.
1111

12+
## PyTorch Enterprise on Azure
13+
{: #pytorch-enterprise-on-azure}
14+
15+
Microsoft is one of the founding members and also the inaugural participant of the [PyTorch Enterprise Support Program](https://pytorch.org/enterprise-support-program). Microsoft offers PyTorch Enterprise on Azure as a part of Microsoft [Premier](https://www.microsoft.com/en-us/msservices/premier-support) and [Unified](https://www.microsoft.com/en-us/msservices/unified-support-solutions?activetab=pivot1:primaryr4) Support. The PyTorch Enterprise support service includes long-term support to selected versions of PyTorch for up to 2 years, prioritized troubleshooting, and the latest integration with [Azure Machine Learning](https://azure.microsoft.com/en-us/services/machine-learning/) and other PyTorch add-ons including ONNX Runtime for faster inference.ย 
16+
17+
To learn more and get started with PyTorch Enterprise on Microsoft Azure, [visit here](https://azure.microsoft.com/en-us/develop/pytorch/).
18+
1219
## Azure Primer
1320
{: #microsoft-azure-primer}
1421

โ€Ž_get_started/installation/linux.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ For the majority of PyTorch users, installing from a pre-built binary via a pack
141141
### Prerequisites
142142
{: #linux-prerequisites-2}
143143

144-
1. Install Anaconda[#anaconda]
144+
1. Install [Anaconda](#anaconda)
145145
2. Install [CUDA](https://developer.nvidia.com/cuda-downloads), if your machine has a [CUDA-enabled GPU](https://developer.nvidia.com/cuda-gpus).
146-
3. Follow the steps described here: https://github.com/pytorch/pytorch#from-source
146+
3. Follow the steps described here: [https://github.com/pytorch/pytorch#from-source](https://github.com/pytorch/pytorch#from-source)
147147

148148
You can verify the installation as described [above](#linux-verification).

โ€Ž_get_started/installation/mac.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ For the majority of PyTorch users, installing from a pre-built binary via a pack
9696

9797
1. Install [Anaconda](#anaconda)
9898
2. Install [CUDA](https://developer.nvidia.com/cuda-downloads), if your machine has a [CUDA-enabled GPU](https://developer.nvidia.com/cuda-gpus).
99-
3. Follow the steps described here: https://github.com/pytorch/pytorch#from-source
99+
3. Follow the steps described here: [https://github.com/pytorch/pytorch#from-source](https://github.com/pytorch/pytorch#from-source)
100100

101101
You can verify the installation as described [above](#mac-verification).

โ€Ž_get_started/previous-versions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cpuonly -c pyt
101101
##### OSX
102102

103103
```
104-
pip install torch==1.7.1 torchvision==0.8.2 torchaudio=0.7.2
104+
pip install torch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2
105105
```
106106

107107
##### Linux and Windows
@@ -158,7 +158,7 @@ conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cpuonly -c pyt
158158
##### OSX
159159

160160
```
161-
pip install torch==1.7.0 torchvision==0.8.0 torchaudio=0.7.0
161+
pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0
162162
```
163163

164164
##### Linux and Windows

โ€Ž_includes/contributor_side_nav.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="col-md-3 get-started-cloud-sidebar">
22
<div class="sticky-top">
33
<ul id="get-started-contributor-sidebar-list">
4-
{% assign past_issues = site.past_issues | sort_natural: "date" %}
4+
{% assign past_issues = site.past_issues | sort_natural: "date" | reverse %}
55

66
{% for item in past_issues %}
77
{% assign currentdate = item.date | date: "%B %Y" %}
@@ -11,7 +11,7 @@
1111
{% endif %}
1212

1313
<ul>
14-
<li><a href="#issue-{{ item.issue }}">{{ item.title }}</a></li>
14+
<li><a href="#issue-{{ item.issue }}">{{ date }}</a></li>
1515
</ul>
1616
{% endfor %}
1717
</ul>

โ€Ž_includes/footer.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ <h2>์ปค๋ฎค๋‹ˆํ‹ฐ</h2>
5050

5151
<div class="trademark-disclaimer">
5252
<ul>
53-
<li>์ด ์‚ฌ์ดํŠธ๋Š” PyTorch ํ•œ๊ตญ์–ด ์‚ฌ์šฉ์ž ์ปค๋ฎค๋‹ˆํ‹ฐ๋กœ Facebook, Inc์™€ ๊ด€๋ จ์ด ์—†์Šต๋‹ˆ๋‹ค. PyTorch, PyTorch ๋กœ๊ณ  ๋ฐ ๋ชจ๋“  ๊ด€๋ จ ํ‘œ๊ธฐ๋Š” Facebook, Inc์˜ ์ƒํ‘œ์ž…๋‹ˆ๋‹ค.</li>
54-
<li>This site is a user community and is not related with Facebook, Inc. PyTorch, the PyTorch logo and any related marks are trademarks of Facebook, Inc.</li>
53+
<li>์ด ์‚ฌ์ดํŠธ๋Š” PyTorch ํ•œ๊ตญ ์‚ฌ์šฉ์ž ์ปค๋ฎค๋‹ˆํ‹ฐ๋กœ Facebook, Inc์—์„œ ์šด์˜ํ•˜๋Š” ์‚ฌ์ดํŠธ๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. PyTorch, PyTorch ๋กœ๊ณ  ๋ฐ ๋ชจ๋“  ๊ด€๋ จ ํ‘œ๊ธฐ๋Š” Facebook, Inc์˜ ์ƒํ‘œ์ž…๋‹ˆ๋‹ค.</li>
54+
<li>This site is a user community and is not operated by Facebook, Inc. PyTorch, the PyTorch logo and any related marks are trademarks of Facebook, Inc.</li>
5555
</ul>
5656
</div>
5757
</div>

โ€Ž_includes/quick_start_cloud_options.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
<div class="cloud-option-row">
4646
<div class="cloud-option" data-toggle="cloud-dropdown">
4747
<div class="cloud-option-body microsoft-azure" id="microsoft-azure">
48-
Microsoft Azure
48+
<p>Microsoft Azure -</p>
49+
<span>PyTorch Enterprise Program</span>
4950
</div>
5051

5152
<ul>

โ€Ž_includes/quick_start_local.html

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p>์‚ฌ์šฉ ํ™˜๊ฒฝ์„ ์„ ํƒํ•˜๊ณ  ์„ค์น˜ ๋ช…๋ น์„ ๋ณต์‚ฌํ•ด์„œ ์‹คํ–‰ํ•ด ๋ณด์„ธ์š”. Stable ๋ฒ„์ „์€ ํ…Œ์ŠคํŠธ ๋ฐ ์ง€์›๋˜๊ณ  ์žˆ๋Š” ๊ฐ€์žฅ ์ตœ๊ทผ์˜ PyTorch ๋ฒ„์ „์œผ๋กœ, ๋Œ€๋ถ€๋ถ„์˜ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค.
2-
Preview ๋ฒ„์ „์€ ์•„์ง ์™„์ „ํžˆ ํ…Œ์ŠคํŠธ๋˜์ง€ ์•Š์€ ์ตœ์‹  1.9 ๋ฒ„์ „์œผ๋กœ ๋งค์ผ ์—…๋ฐ์ดํŠธ๋ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ ์ค‘์ธ ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €์— ๋”ฐ๋ผ <b>์•„๋ž˜์˜ ์‚ฌ์ „ ์š”๊ตฌ์‚ฌํ•ญ(์˜ˆ: numpy)</b>์ด ์ถฉ์กฑ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด ์ฃผ์„ธ์š”.
2+
Preview ๋ฒ„์ „์€ ์•„์ง ์™„์ „ํžˆ ํ…Œ์ŠคํŠธ๋˜์ง€ ์•Š์€ ์ตœ์‹  1.10 ๋ฒ„์ „์œผ๋กœ ๋งค์ผ ์—…๋ฐ์ดํŠธ๋ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ ์ค‘์ธ ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €์— ๋”ฐ๋ผ <b>์•„๋ž˜์˜ ์‚ฌ์ „ ์š”๊ตฌ์‚ฌํ•ญ(์˜ˆ: numpy)</b>์ด ์ถฉ์กฑ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด ์ฃผ์„ธ์š”.
33
๋ชจ๋“  ์˜์กด์„ฑ์„ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋Š” Anaconda๋ฅผ ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €๋กœ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค. <a href="{{ site.baseurl }}/get-started/previous-versions">์ด์ „ ๋ฒ„์ „์˜ PyTorch๋„ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค</a>. LibTorch๋Š” C++์—์„œ๋งŒ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
44
</p>
55

@@ -30,12 +30,15 @@
3030
<div class="col-md-12 title-block mobile-heading">
3131
<div class="option-text">PyTorch ๋นŒ๋“œ</div>
3232
</div>
33-
<div class="col-md-6 option block version selected" id="stable">
34-
<div class="option-text">Stable (1.8.1)</div>
33+
<div class="col-md-4 option block version selected" id="stable">
34+
<div class="option-text">Stable (1.9.0)</div>
3535
</div>
36-
<div class="col-md-6 option block version" id="preview">
36+
<div class="col-md-4 option block version" id="preview">
3737
<div class="option-text">Preview (Nightly)</div>
3838
</div>
39+
<div class="col-md-4 option block version" id="lts">
40+
<div class="option-text">LTS (1.8.1)</div>
41+
</div>
3942
</div>
4043
<div class="row os">
4144
<div class="col-md-12 title-block mobile-heading">
@@ -89,8 +92,8 @@
8992
<div class="col-md-3 option block version" id="cuda11.1">
9093
<div class="option-text">CUDA 11.1</div>
9194
</div>
92-
<div class="col-md-3 option block version" id="rocm4.0">
93-
<div class="option-text">ROCm 4.0 (beta)</div>
95+
<div class="col-md-3 option block version" id="rocm4.2">
96+
<div class="option-text">ROCm 4.2 (beta)</div>
9497
</div>
9598
<div class="col-md-3 option block version" id="accnone">
9699
<div class="option-text">CPU</div>

โ€Ž_layouts/blog.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<h1 class="blog-index-title">
2020
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
2121
</h1>
22-
<p class="featured-blog-preview">{{ post.excerpt | remove: '<p>' | remove: '</p>' | truncate: 100 }}</p>
22+
<p class="featured-blog-preview">{{ post.excerpt | strip_html | truncate: 100 }}</p>
2323

2424
<a href="{{ site.baseurl }}{{ post.url }}" class="btn btn-lg with-right-arrow">
2525
Read More

โ€Ž_layouts/hub_detail.html

+13-4
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,23 @@ <h1>
2020
</h1>
2121

2222
<div class="row">
23-
<div class="col-md-6">
23+
<div class="col-md-4">
2424
<p class="detail-lead">By {{ page.author }} </p>
2525
</div>
2626

27-
<div class="col-md-6">
27+
<div class="col-md-8">
2828
<p class="detail-lead lead-summary">{{ page.summary }}</p>
29-
<a href="{{ page.github-link }}"><button class="btn btn-lg with-right-white-arrow detail-github-link">View on Github</button></a>
30-
<a href="https://colab.research.google.com/github/pytorch/pytorch.github.io/blob/master/{{ page.path | replace: "_hub", "assets/hub" | replace: ".md", ".ipynb" }}"><button class="btn btn-lg with-right-white-arrow detail-colab-link">Open on Google Colab</button></a>
29+
<div class="detail-button-container">
30+
<a href="{{ page.github-link }}"><button class="btn btn-lg with-right-white-arrow detail-github-link">View on Github</button></a>
31+
<a href="https://colab.research.google.com/github/pytorch/pytorch.github.io/blob/master/{{ page.path | replace: "_hub", "assets/hub" | replace: ".md", ".ipynb" }}"><button class="btn btn-lg with-right-white-arrow detail-colab-link">Open on Google Colab</button></a>
32+
{% if page.demo-model-link %}
33+
{% if page.demo-model-button-text == blank or page.demo-model-button-text == nil %}
34+
<a href="{{ page.demo-model-link }}"><button class="btn btn-lg with-right-white-arrow detail-web-demo-link">Demo Model Output</button></a>
35+
{% else %}
36+
<a href="{{ page.demo-model-link }}"><button class="btn btn-lg with-right-white-arrow detail-web-demo-link">{{ page.demo-model-button-text }}</button></a>
37+
{% endif %}
38+
{% endif %}
39+
</div>
3140
</div>
3241
</div>
3342
</div>

โ€Ž_mobile/android.md

+27-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This application runs TorchScript serialized TorchVision pretrained resnet18 mod
1717

1818
#### 1. Model Preparation
1919

20-
Letโ€™s start with model preparation. If you are familiar with PyTorch, you probably should already know how to train and save your model. In case you donโ€™t, we are going to use a pre-trained image classification model ([Resnet18](https://pytorch.org/hub/pytorch_vision_resnet/)), which is packaged in [TorchVision](https://pytorch.org/docs/stable/torchvision/index.html).
20+
Letโ€™s start with model preparation. If you are familiar with PyTorch, you probably should already know how to train and save your model. In case you donโ€™t, we are going to use a pre-trained image classification model ([MobileNetV2](https://pytorch.org/hub/pytorch_vision_mobilenet_v2/)).
2121
To install it, run the command below:
2222
```
2323
pip install torchvision
@@ -27,14 +27,17 @@ To serialize the model you can use python [script](https://github.com/pytorch/an
2727
```
2828
import torch
2929
import torchvision
30+
from torch.utils.mobile_optimizer import optimize_for_mobile
3031
31-
model = torchvision.models.resnet18(pretrained=True)
32+
model = torchvision.models.mobilenet_v2(pretrained=True)
3233
model.eval()
3334
example = torch.rand(1, 3, 224, 224)
3435
traced_script_module = torch.jit.trace(model, example)
35-
traced_script_module.save("app/src/main/assets/model.pt")
36+
traced_script_module_optimized = optimize_for_mobile(traced_script_module)
37+
traced_script_module_optimized._save_for_lite_interpreter("app/src/main/assets/model.ptl")
38+
3639
```
37-
If everything works well, we should have our model - `model.pt` generated in the assets folder of android application.
40+
If everything works well, we should have our model - `model.ptl` generated in the assets folder of android application.
3841
That will be packaged inside android application as `asset` and can be used on the device.
3942

4043
More details about TorchScript you can find in [tutorials on pytorch.org](https://pytorch.org/docs/stable/jit.html)
@@ -62,8 +65,8 @@ repositories {
6265
}
6366
6467
dependencies {
65-
implementation 'org.pytorch:pytorch_android:1.4.0'
66-
implementation 'org.pytorch:pytorch_android_torchvision:1.4.0'
68+
implementation 'org.pytorch:pytorch_android_lite:1.9.0'
69+
implementation 'org.pytorch:pytorch_android_torchvision:1.9.0'
6770
}
6871
```
6972
Where `org.pytorch:pytorch_android` is the main dependency with PyTorch Android API, including libtorch native library for all 4 android abis (armeabi-v7a, arm64-v8a, x86, x86_64).
@@ -79,11 +82,11 @@ As a first step we read `image.jpg` to `android.graphics.Bitmap` using the stand
7982
Bitmap bitmap = BitmapFactory.decodeStream(getAssets().open("image.jpg"));
8083
```
8184

82-
#### 5. Loading TorchScript Module
85+
#### 5. Loading Mobile Module
8386
```
84-
Module module = Module.load(assetFilePath(this, "model.pt"));
87+
Module module = Module.load(assetFilePath(this, "model.ptl"));
8588
```
86-
`org.pytorch.Module` represents `torch::jit::script::Module` that can be loaded with `load` method specifying file path to the serialized to file model.
89+
`org.pytorch.Module` represents `torch::jit::mobile::Module` that can be loaded with `load` method specifying file path to the serialized to file model.
8790

8891
#### 6. Preparing Input
8992
```
@@ -387,6 +390,21 @@ SELECTED_OP_LIST=MobileNetV2.yaml scripts/build_pytorch_android.sh arm64-v8a
387390

388391
After successful build you can integrate the result aar files to your android gradle project, following the steps from previous section of this tutorial (Building PyTorch Android from Source).
389392

393+
## Use PyTorch JIT interpreter
394+
395+
PyTorch JIT interpreter is the default interpreter before 1.9 (a version of our PyTorch interpreter that is not as size-efficient). It will still be supported in 1.9, and can be used via `build.gradle`:
396+
```
397+
repositories {
398+
jcenter()
399+
}
400+
401+
dependencies {
402+
implementation 'org.pytorch:pytorch_android:1.9.0'
403+
implementation 'org.pytorch:pytorch_android_torchvision:1.9.0'
404+
}
405+
```
406+
407+
390408
## Android Tutorials
391409

392410
Watch the following [video](https://youtu.be/5Lxuu16_28o) as PyTorch Partner Engineer Brad Heintz walks through steps for setting up the PyTorch Runtime for Android projects:

โ€Ž_mobile/home.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ PyTorch Mobile is in beta stage right now, and is already in wide scale producti
2424
* Support for tracing and scripting via TorchScript IR
2525
* Support for XNNPACK floating point kernel libraries for Arm CPUs
2626
* Integration of QNNPACK for 8-bit quantized kernels. Includes support for per-channel quantization, dynamic quantization and more
27-
* Build level optimization and selective compilation depending on the operators needed for user applications, i.e., the final binary size of the app is determined by the actual operators the app needs
27+
* Provides an [efficient mobile interpreter in Android and iOS](https://pytorch.org/tutorials/recipes/mobile_interpreter.html). Also supports build level optimization and selective compilation depending on the operators needed for user applications (i.e., the final binary size of the app is determined by the actual operators the app needs).
2828
* Streamline model optimization via optimize_for_mobile
2929
* Support for hardware backends like GPU, DSP, and NPU will be available soon in Beta
3030

3131

3232
## Prototypes
3333
We have launched the following features in prototype, available in the PyTorch nightly releases, and would love to get your feedback on the [PyTorch forums](https://discuss.pytorch.org/c/mobile/18):
3434

35-
* Runtime binary size reduction via our [Lite Interpreter](https://pytorch.org/tutorials/prototype/lite_interpreter.html)
3635
* GPU support on [iOS via Metal](https://pytorch.org/tutorials/prototype/ios_gpu_workflow.html)
3736
* GPU support on [Android via Vulkan](https://pytorch.org/tutorials/prototype/vulkan_workflow.html)
3837
* DSP and NPU support on Android via [Google NNAPI](https://pytorch.org/tutorials/prototype/nnapi_mobilenetv2.html)

โ€Ž_mobile/ios.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ private lazy var module: TorchModule = {
9494
}
9595
}()
9696
```
97-
Note that the `TorchModule` Class is an Objective-C wrapper of `torch::jit::script::Module`.
97+
Note that the `TorchModule` Class is an Objective-C wrapper of `torch::jit::mobile::Module`.
9898

9999
```cpp
100-
torch::jit::script::Module module = torch::jit::load(filePath.UTF8String);
100+
torch::jit::mobile::Module module = torch::jit::_load_for_mobile(filePath.UTF8String);
101101
```
102102
Since Swift can not talk to C++ directly, we have to either use an Objective-C class as a bridge, or create a C wrapper for the C++ library. For demo purpose, we're going to wrap everything in this Objective-C class.
103103

@@ -251,7 +251,8 @@ To use the custom built libraries the project, replace `#import <LibTorch/LibTor
251251
#include "caffe2/core/timer.h"
252252
#include "caffe2/utils/string_utils.h"
253253
#include "torch/csrc/autograd/grad_mode.h"
254-
#include "torch/csrc/jit/serialization/import.h"
254+
#include "torch/csrc/jit/mobile/import.h"
255+
#include "torch/csrc/jit/mobile/module.h"
255256
#include "torch/script.h"
256257
```
257258

@@ -289,6 +290,12 @@ SELECTED_OP_LIST=MobileNetV2.yaml BUILD_PYTORCH_MOBILE=1 IOS_ARCH=arm64 ./script
289290
torch::jit::GraphOptimizerEnabledGuard guard(false);
290291
```
291292
293+
## Use PyTorch JIT interpreter
294+
PyTorch JIT interpreter is the default interpreter before 1.9 (a version of our PyTorch interpreter that is not as size-efficient). It will still be supported in 1.9, and can be used in CocoaPods:
295+
```
296+
pod 'LibTorch', '~>1.9.0'
297+
```
298+
292299
## iOS Tutorials
293300
294301
Watch the following [video](https://youtu.be/amTepUIR93k) as PyTorch Partner Engineer Brad Heintz walks through steps for setting up the PyTorch Runtime for iOS projects:

โ€Ž_news/news-item-1.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
order: 1
3-
link: https://pytorch.org/blog/introducing-pytorch-profiler-the-new-and-improved-performance-tool/
4-
summary: (์˜๋ฌธ) Introducing PyTorch Profiler - the new and improved performance tool
3+
link: https://pytorch.org/blog/pytorch-1.9-released
4+
summary: (์˜๋ฌธ) PyTorch 1.9 Release, including torch.linalg and Mobile Interpreter
55
---
6+
7+

โ€Ž_news/news-item-2.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
order: 2
3-
link: https://github.com/pytorch/pytorch/releases/tag/v1.8.1
4-
summary: (์˜๋ฌธ) PyTorch 1.8.1 is now available with improvements and bug fixes
3+
link: https://pytorch.org/blog/pytorch-1.9-new-library-releases
4+
summary: (์˜๋ฌธ) New PyTorch Library Releases in PyTorch 1.9, including TorchVision, TorchAudio, and more
55
---
66

โ€Ž_news/news-item-3.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
order: 3
3-
link: https://pytorch.org/blog/ecosystem_day_2021/
4-
summary: (์˜๋ฌธ) Announcing PyTorch Ecosystem Day - April 21, 2021
3+
link: https://github.com/pytorch/pytorch/releases/tag/v1.8.1
4+
summary: (์˜๋ฌธ) PyTorch 1.8.1 is now available with improvements and bug fixes
55
---
66

โ€Ž_sass/article.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
article.pytorch-article {
22
max-width: 920px;
33
margin: 0 auto;
4+
padding-bottom: 90px;
45

56
h2,
67
h3,

0 commit comments

Comments
ย (0)