---
title: Install
description: 'Follow these instructions to install PyTorch, nvFuser, and finally Thunder.'
canonical: 'https://lightning.ai/docs/thunder/stable/home/installation'
---
# Install {#install}

## Minimal dependencies {#minimal-dependencies}

Follow these instructions to install PyTorch, nvFuser, and finally Thunder.

Install PyTorch and nvFuser with pip (command shown is for CUDA 12.1 and PyTorch 2.5.x):

```bash
pip install --pre nvfuser-cu121-torch25
```

cu121 can be replaced with cu118 depending on your CUDA version. NVFuser builds typically support the latest point release of PyTorch stable versions.
For torch 2.5, cu124 is also supported. For nightly versions and more detailed instructions, please see https://github.com/NVIDIA/Fuser/#installation

You're all set with minimal dependencies, so you can follow [Install Thunder](#install-thunder).

Dependencies so far don't include additional optimized kernels for execution like OpenAI Triton, cuDNN Fusion, or Apex.
These are described in the following section, [Optional dependencies](#optional-dependencies).

## Optional dependencies {#optional-dependencies}

### Install Apex {#install-apex}

Thunder can use NVIDIA's Apex to accelerate some PyTorch operations. To install the Apex executor, first clone the Apex git repository and then execute the following command in the project's root directory:

```bash
git clone https://github.com/NVIDIA/apex.git
cd apex

pip install -v --no-cache-dir --no-build-isolation --config-settings "--build-option=--xentropy" ./
```

### Install cuDNN {#install-cudnn}

Thunder can use NVIDIA's cuDNN Python frontend bindings to accelerate some PyTorch operations. cuDNN backend is a pure-lib python package which needs to downloaded separately.

> pip install nvidia-cudnn-cu12
> pip install nvidia-cudnn-frontend

You're all set, now follow [Install Thunder](#install-thunder).

### Install OpenAI Triton {#install-openai-triton}

Thunder can easily integrate OpenAI Triton kernels. You can install Triton using:

```bash
pip install triton

```

## Install Thunder {#install-thunder}

You can now install Thunder:

```bash
pip install git+https://github.com/Lightning-AI/lightning-thunder.git
```

Alternatively you can clone the Thunder repository and install locally:

```bash
git clone https://github.com/Lightning-AI/lightning-thunder.git
cd lightning-thunder

pip install .

```

---

**Navigation**

- Parent: [Home](/docs/thunder/0.2.6/home.md)
