Skip to content

Commit 0a422c2

Browse files
authored
Merge branch 'main' into dl/fx/openvino_quantizer
2 parents 090823f + a5632da commit 0a422c2

File tree

3 files changed

+28
-21
lines changed

3 files changed

+28
-21
lines changed

index.rst

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ Welcome to PyTorch Tutorials
33

44
**What's new in PyTorch tutorials?**
55

6-
* `Dynamic Compilation Control with torch.compiler.set_stance <https://pytorch.org/tutorials/recipes/torch_compiler_set_stance_tutorial.html>`__
7-
* `Accelerating PyTorch Transformers by replacing nn.Transformer with Nested Tensors and torch.compile() <https://pytorch.org/tutorials/intermediate/transformer_building_blocks.html>`__
8-
* `Understanding the torch.export Flow and Solutions to Common Challenges <https://pytorch.org/tutorials/recipes/torch_export_challenges_solutions.html>`__
9-
* Updated `torch.export Tutorial <https://pytorch.org/tutorials/intermediate/torch_export_tutorial.html#constraints-dynamic-shapes>`__ with automatic dynamic shapes ``Dim.AUTO``
10-
* Updated `torch.export AOTInductor Tutorial for Python runtime <https://pytorch.org/tutorials/recipes/torch_export_aoti_python.html>`__
11-
* Updated `Using User-Defined Triton Kernels with torch.compile <https://pytorch.org/tutorials/recipes/torch_compile_user_defined_triton_kernel_tutorial.html#composability>`__ with new ``torch.library.triton_op``
12-
* Updated `Compile Time Caching in torch.compile <https://pytorch.org/tutorials/recipes/torch_compile_caching_tutorial.html>`__ with new ``Mega-Cache``
6+
* `Utilizing Torch Function modes with torch.compile <https://pytorch.org/tutorials/recipes/torch_compile_torch_function_modes.html>`__
7+
* `Context Parallel Tutorial <https://pytorch.org/tutorials/prototype/context_parallel.html>`__
8+
* `PyTorch 2 Export Quantization with Intel GPU Backend through Inductor <https://pytorch.org/tutorials/prototype/pt2e_quant_xpu_inductor.html>`__
9+
* `(beta) Explicit horizontal fusion with foreach_map and torch.compile <https://pytorch.org/tutorials/recipes/foreach_map.html>`__
10+
* Updated `Inductor Windows CPU Tutorial <https://pytorch.org/tutorials/prototype/inductor_windows.html>`__
1311

1412
.. raw:: html
1513

prototype_source/inductor_windows.rst

+13-10
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,21 @@ Next, let's configure our environment.
4444
4545
"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat"
4646
#. Create and activate a virtual environment: ::
47+
4748
#. Install `PyTorch 2.5 <https://pytorch.org/get-started/locally/>`_ or later for CPU Usage. Install PyTorch 2.7 or later refer to `Getting Started on Intel GPU <https://pytorch.org/docs/main/notes/get_start_xpu.html>`_ for XPU usage.
49+
4850
#. Here is an example of how to use TorchInductor on Windows:
49-
.. code-block:: python
50-
51-
import torch
52-
device="cpu" # or "xpu" for XPU
53-
def foo(x, y):
54-
a = torch.sin(x)
55-
b = torch.cos(x)
56-
return a + b
57-
opt_foo1 = torch.compile(foo)
58-
print(opt_foo1(torch.randn(10, 10).to(device), torch.randn(10, 10).to(device)))
51+
52+
.. code-block:: python
53+
54+
import torch
55+
device="cpu" # or "xpu" for XPU
56+
def foo(x, y):
57+
a = torch.sin(x)
58+
b = torch.cos(x)
59+
return a + b
60+
opt_foo1 = torch.compile(foo)
61+
print(opt_foo1(torch.randn(10, 10).to(device), torch.randn(10, 10).to(device)))
5962
6063
#. Below is the output of the above example::
6164

recipes_source/foreach_map.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
2-
(beta) Explicit horizontal fusion with foreach_map and torch.compile
3-
============================================================
2+
Explicit horizontal fusion with foreach_map and torch.compile
3+
===============================================================
44
55
**Author:** `Michael Lazos <https://github.com/mlazos>`_
66
"""
@@ -13,11 +13,17 @@
1313
# allows conversion of any pointwise op in ``torch`` to a horiztonally fused foreach
1414
# variant. In this tutorial, we will demonstrate how to implement the Adam optimizer
1515
# with ``foreach_map`` to generate a fully fused kernel.
16-
#
1716
#
1817
# .. note::
1918
#
20-
# This tutorial requires PyTorch 2.7.0 or later.
19+
# This recipe describes a prototype feature. Prototype features are typically
20+
# at an early stage for feedback and testing and are subject to change.
21+
#
22+
# Prerequisites
23+
# -------------
24+
#
25+
# * PyTorch v2.7.0 or later
26+
#
2127

2228
#####################################################################
2329
# Model Setup

0 commit comments

Comments
 (0)