installation.rst 3.59 KB
Newer Older
Przemek Tredak's avatar
Przemek Tredak committed
1
..
2
    Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Przemek Tredak's avatar
Przemek Tredak committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16

    See LICENSE for license information.

Installation
============

Prerequisites
-------------
.. |driver link| replace:: NVIDIA Driver
.. _driver link: https://www.nvidia.com/drivers

1. Linux x86_64
2. `CUDA 11.8 <https://developer.nvidia.com/cuda-downloads>`__
3. |driver link|_ supporting CUDA 11.8 or later.
17
4. `cuDNN 8.1 <https://developer.nvidia.com/cudnn>`__ or later.
18
5. For FP8/FP16/BF16 fused attention, `CUDA 12.1 <https://developer.nvidia.com/cuda-downloads>`__ or later, |driver link|_ supporting CUDA 12.1 or later, and `cuDNN 8.9.1 <https://developer.nvidia.com/cudnn>`__ or later.
Przemek Tredak's avatar
Przemek Tredak committed
19

Tim Moon's avatar
Tim Moon committed
20
21
22
If the CUDA Toolkit headers are not available at runtime in a standard
installation path, e.g. within `CUDA_HOME`, set
`NVTE_CUDA_INCLUDE_PATH` in the environment.
Przemek Tredak's avatar
Przemek Tredak committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36

Transformer Engine in NGC Containers
------------------------------------

Transformer Engine library is preinstalled in the PyTorch container in versions 22.09 and later
on `NVIDIA GPU Cloud <https://ngc.nvidia.com>`_.


pip - from GitHub
-----------------------

Additional Prerequisites
^^^^^^^^^^^^^^^^^^^^^^^^

Tim Moon's avatar
Tim Moon committed
37
38
1. [For PyTorch support] `PyTorch <https://pytorch.org/>`__ with GPU support.
2. [For JAX support] `JAX <https://github.com/google/jax/>`__ with GPU support, version >= 0.4.7.
Przemek Tredak's avatar
Przemek Tredak committed
39
40
41
42
43
44
45
46

Installation (stable release)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Execute the following command to install the latest stable version of Transformer Engine:

.. code-block:: bash

Tim Moon's avatar
Tim Moon committed
47
48
  pip install git+https://github.com/NVIDIA/TransformerEngine.git@stable

49
This will automatically detect if any supported deep learning frameworks are installed and build Transformer Engine support for them. To explicitly specify frameworks, set the environment variable `NVTE_FRAMEWORK` to a comma-separated list (e.g. `NVTE_FRAMEWORK=jax,pytorch`).
Przemek Tredak's avatar
Przemek Tredak committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63

Installation (development build)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. warning::

   While the development build of Transformer Engine could contain new features not available in
   the official build yet, it is not supported and so its usage is not recommended for general
   use.

Execute the following command to install the latest development build of Transformer Engine:

.. code-block:: bash

Tim Moon's avatar
Tim Moon committed
64
65
  pip install git+https://github.com/NVIDIA/TransformerEngine.git@main

66
This will automatically detect if any supported deep learning frameworks are installed and build Transformer Engine support for them. To explicitly specify frameworks, set the environment variable `NVTE_FRAMEWORK` to a comma-separated list (e.g. `NVTE_FRAMEWORK=jax,pytorch`).
Tim Moon's avatar
Tim Moon committed
67

68
69
70
71
72
73
74
In order to install a specific PR, execute after changing NNN to the PR number:

.. code-block:: bash

  pip install git+https://github.com/NVIDIA/TransformerEngine.git@refs/pull/NNN/merge


75
76
77
78
79
80
81
Installation (from source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Execute the following commands to install Transformer Engine from source:

.. code-block:: bash

Tim Moon's avatar
Tim Moon committed
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
  # Clone repository, checkout stable branch, clone submodules
  git clone --branch stable --recursive https://github.com/NVIDIA/TransformerEngine.git

  cd TransformerEngine
  export NVTE_FRAMEWORK=pytorch   # Optionally set framework
  pip install .                   # Build and install

If the Git repository has already been cloned, make sure to also clone the submodules:

.. code-block:: bash

  git submodule update --init --recursive

Extra dependencies for testing can be installed by setting the "test" option:

.. code-block:: bash

  pip install .[test]
100

Tim Moon's avatar
Tim Moon committed
101
To build the C++ extensions with debug symbols, e.g. with the `-g` flag:
102
103
104

.. code-block:: bash

Tim Moon's avatar
Tim Moon committed
105
  pip install . --global-option=--debug