Skip to content

Fix code snippet format issue in inductor_windows #3339

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

Merged
merged 32 commits into from
Apr 22, 2025
Merged
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1d49a44
update link to a intel compiler guide with performance data
ZhaoqiongZ Oct 21, 2024
d3f2ca0
update
ZhaoqiongZ Oct 21, 2024
7335f5b
add title on the link
ZhaoqiongZ Oct 21, 2024
a773e9b
update
ZhaoqiongZ Oct 21, 2024
53f3886
rephrase the sentence
ZhaoqiongZ Oct 21, 2024
ca95172
Merge branch 'main' into main
ZhaoqiongZ Oct 21, 2024
372f0c9
Merge branch 'main' into main
svekars Oct 22, 2024
7aae4e6
Merge branch 'pytorch:main' into main
ZhaoqiongZ Mar 31, 2025
3f09390
update inductor windows with xpu support
ZhaoqiongZ Mar 31, 2025
ab6da28
Update conclusion inductor_windows.rst
ZhaoqiongZ Apr 1, 2025
615f97b
Update inductor_windows.rst
ZhaoqiongZ Apr 1, 2025
1ce21b9
Merge branch 'main' into main
ZhaoqiongZ Apr 2, 2025
8cac362
add inductor_windows_cpu and redirect to inductor_windows
ZhaoqiongZ Apr 3, 2025
e40b266
update inductor_windows
ZhaoqiongZ Apr 4, 2025
9bc6895
Merge branch 'main' into main
ZhaoqiongZ Apr 14, 2025
8fff638
Merge branch 'main' into main
svekars Apr 15, 2025
a81c441
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
836b2b9
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
5af0cd5
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
c8f5f6c
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
62358be
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
fcbd371
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
a90c38a
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
8202be7
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
b41b86c
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
2ce29a0
Update prototype_source/inductor_windows.rst
ZhaoqiongZ Apr 17, 2025
eec7ebf
Merge branch 'main' into main
svekars Apr 18, 2025
65d011d
Merge branch 'pytorch:main' into main
ZhaoqiongZ Apr 22, 2025
830c3de
fix code format
ZhaoqiongZ Apr 22, 2025
38ef79d
fix typo
ZhaoqiongZ Apr 22, 2025
86e9ab5
Update prototype_source/inductor_windows.rst
svekars Apr 22, 2025
b72f2e8
Merge branch 'main' into main
svekars Apr 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions prototype_source/inductor_windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,21 @@ Next, let's configure our environment.

"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat"
#. Create and activate a virtual environment: ::

#. 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.
#. Here is an example of how to use TorchInductor on Windows:
.. code-block:: python

import torch
device="cpu" # or "xpu" for XPU
def foo(x, y):
a = torch.sin(x)
b = torch.cos(x)
return a + b
opt_foo1 = torch.compile(foo)
print(opt_foo1(torch.randn(10, 10).to(device), torch.randn(10, 10).to(device)))

#. Here is an example of how to use TorchInductor on Windows ::

.. code-block:: python

import torch
device="cpu" # or "xpu" for XPU
def foo(x, y):
a = torch.sin(x)
b = torch.cos(x)
return a + b
opt_foo1 = torch.compile(foo)
print(opt_foo1(torch.randn(10, 10).to(device), torch.randn(10, 10).to(device)))

#. Below is the output of the above example::

Expand Down