Skip to content

Install Dependencies

jhelsby edited this page Aug 30, 2024 · 2 revisions

Common

Once you have cloned the source code, enter the PyTorch directory in your terminal and run the following:

conda install cmake ninja
pip install -r requirements.txt

Now proceed to the section for your OS below: Linux, MacOS, or Windows.

On Linux

conda install mkl mkl-include

# CUDA only: Add LAPACK support for the GPU if needed
conda install -c pytorch magma-cuda110  # or the magma-cuda* that matches your CUDA version from https://anaconda.org/pytorch/repo

# (optional) If using torch.compile with inductor/triton, install the matching version of triton
# Run from the pytorch directory after cloning
make triton

On MacOS

# Add this package on intel x86 processor machines only
conda install mkl mkl-include

# Add these packages if torch.distributed is needed
conda install pkg-config libuv

On Windows

conda install mkl mkl-include

# Add these packages if torch.distributed is needed.
# Distributed package support on Windows is a prototype feature and is subject to changes.
conda install -c conda-forge libuv=1.39

Next Steps

Clone this wiki locally