Skip to content

Commit

Permalink
update alternative compiler section
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoqiongZ committed Sep 27, 2024
1 parent 2532f65 commit c52fd8d
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions prototype_source/inductor_windows_cpu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ TorchInductor is the new compiler backend that compiles the FX Graphs generated
This tutorial introduces the steps for utilizing TorchInductor on Windows CPU.



Software Installation
---------------------

Expand All @@ -32,21 +31,6 @@ During Installation, chosse `Desktop Development with C++` in the `Desktop & Mob
Windows inductor also support C++ compiler `LLVM Compiler <https://github.com/llvm/llvm-project/releases>`_ and `Intel Compiler <https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler-download.html>`_ for better performance.
Please check `Alternative Compiler for better performance <#alternative-compiler-for-better-performance>`_.

Alternative Compiler for better performance
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To enhance performance on Windows inductor, you can use the Intel Compiler or LLVM Compiler. However, windows inductor rely on the runtime libraries from Microsoft Visual C++ (MSVC). Therefore, your first step should be to install MSVC.

Intel Compiler
~~~~~~~~~~~~~~
#. Download and install `Intel Compiler <https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler-download.html>`_ with Windows version.
#. Set compiler `CXX=icx-cl`

LLVM Compiler
~~~~~~~~~~~~~
#. Download and install `LLVM Compiler <https://github.com/llvm/llvm-project/releases>`_ with Windows version.
#. Set compiler `CXX=clang-cl`

Install Miniforge
^^^^^^^^^^^^^^^^^

Expand All @@ -65,6 +49,8 @@ Set Up Environment
#. Create and activate customer conda environment::

conda create -n inductor_cpu_windows python=3.10 -y
#. Activate customer conda environment::

conda activate inductor_cpu_windows
#. Install `PyTorch 2.5 <https://pytorch.org/get-started/locally/>`_ or later.
#. Use torchinductor on Windows CPU::
Expand Down Expand Up @@ -100,7 +86,24 @@ Set Up Environment
[ 5.7244e-04, 1.2799e+00, 1.3595e+00, 1.0907e+00, 3.7191e-01,
1.4062e+00, 1.3672e+00, 6.8502e-02, 8.5216e-01, 8.6046e-01]])

Alternative Compiler for better performance
-------------------------------------------

To enhance performance on Windows inductor, you can use the Intel Compiler or LLVM Compiler. However, windows inductor rely on the runtime libraries from Microsoft Visual C++ (MSVC). Therefore, your first step should be to install MSVC.

Intel Compiler
^^^^^^^^^^^^^^

#. Download and install `Intel Compiler <https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler-download.html>`_ with Windows version.
#. Set compiler `CXX=icx-cl`

LLVM Compiler
^^^^^^^^^^^^^

#. Download and install `LLVM Compiler <https://github.com/llvm/llvm-project/releases>`_ with Windows version.
#. Set compiler `CXX=clang-cl`

Conclusion
----------

With this tutorial, we introduce how to use Inductor on Windows CPU with PyTorch 2.5 or later.
With this tutorial, we introduce how to use Inductor on Windows CPU with PyTorch 2.5 or later. We can use Intel Compiler or LLVM Compiler to get better performance.

0 comments on commit c52fd8d

Please sign in to comment.