installation.md 1.77 KB
Newer Older
1
# Setup
2
3

Requirements:
4
- PyTorch >= 1.11 and PyTorch <= 2.1
5
6
- Python >= 3.7
- CUDA >= 11.0
7
8
- [NVIDIA GPU Compute Capability](https://developer.nvidia.com/cuda-gpus) >= 7.0 (V100/RTX20 and higher)
- Linux OS
9

10
If you encounter any problem about installation, you may want to raise an [issue](https://github.com/hpcaitech/ColossalAI/issues/new/choose) in this repository.
binmakeswell's avatar
binmakeswell committed
11

12
13
14
15
16
17
18
19
20

## Download From PyPI

You can install Colossal-AI with

```shell
pip install colossalai
```

21
22
**Note: only Linux is supported for now**

23
24
25
26
27
28
29
30
31
If you want to build PyTorch extensions during installation, you can use the command below. Otherwise, the PyTorch extensions will be built during runtime.

```shell
CUDA_EXT=1 pip install colossalai
```


## Download From Source

32
> The version of Colossal-AI will be in line with the main branch of the repository. Feel free to raise an issue if you encounter any problem.
33
34
35
36
37
38
39
40
41

```shell
git clone https://github.com/hpcaitech/ColossalAI.git
cd ColossalAI

# install dependency
pip install -r requirements/requirements.txt

# install colossalai
42
CUDA_EXT=1 pip install .
43
44
```

45
If you don't want to install and enable CUDA kernel fusion (compulsory installation when using fused optimizer), just don't specify the `CUDA_EXT`:
46
47

```shell
48
pip install .
49
```
50

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
For Users with CUDA 10.2, you can still build ColossalAI from source. However, you need to manually download the cub library and copy it to the corresponding directory.

```bash
# clone the repository
git clone https://github.com/hpcaitech/ColossalAI.git
cd ColossalAI

# download the cub library
wget https://github.com/NVIDIA/cub/archive/refs/tags/1.8.0.zip
unzip 1.8.0.zip
cp -r cub-1.8.0/cub/ colossalai/kernel/cuda_native/csrc/kernels/include/

# install
CUDA_EXT=1 pip install .
```
66
67

<!-- doc-test-command: echo "installation.md does not need test" -->