Step by step tutorial to install FastMoE on your local machine:
1. First of all you'll need to check your torch and nccl version, make sure to have a CUDA version compatible to the one torch was compiled (in general if you have the latest torch version it works also with the latest CUDA):
```
# go in terminal and use this command, the output should be something like this:
# to check cuda version you can use one of this two options with a similar output,
# the binary path (second option) might be needed for troubleshooting:
nvcc --version
>>> Cuda compilation tools, release 11.7, V11.7.99
>>> Build cuda_11.7.r11.7/compiler.31442593_0
which nvcc
>>> /usr/local/cuda-11.7/bin/nvcc
```
2. An extra NCCL developer package is needed to enable the distributed features of FastMoE at the following link: https://developer.nvidia.com/nccl/nccl-legacy-downloads. Make sure to follow this steps:
```
# following the previous example I'll consider the version 2.14.3 with a CUDA version <= System CUDA version and Ubuntu 20.04
# the first command is different depending on the system and the version, just paste it from the site
3. Now you can clone the repository and enter the folder to launch the installation script as follows:
```
# clone repo and move into the folder
git clone https://github.com/laekov/fastmoe.git
cd fastmoe
# Option 1: disabling distributed features
USE_NCCL=0 python setup.py install
# Option 2: enabling distributed features
python setup.py install
```
#### Troubleshooting
If you have errors (warnings are OK) during the compilation make sure that the installer has the correct flags, this can be seen in the error as `-I/path/to/xxx/bin` and `-L/path/to/xxx/lib`. This flags should point to the correct CUDA for which all the other packages are compatible (torch and NCCL), if this paths are not correct you'll have to tell the system explicitly which CUDA version you want to use. Simple solutions could be this:
```
# (suggested) export the correct paths before compiling