|
#!/bin/zsh |
|
|
|
|
|
|
|
|
|
ENV_NAME=towerllm-env |
|
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
|
DIR="$(dirname "$DIR")" |
|
|
|
set -eo pipefail |
|
|
|
|
|
if [ -z "$CONDA_HOME" ] |
|
then |
|
echo "Please set CONDA_HOME to the location of your conda installation" |
|
exit 1 |
|
fi |
|
source ${CONDA_HOME}/etc/profile.d/conda.sh |
|
|
|
conda install -y -c conda-forge mamba |
|
mamba create -y -n ${ENV_NAME} python=3.9 |
|
conda activate ${ENV_NAME} |
|
|
|
|
|
mamba install -y -c conda-forge git |
|
mamba install -y "gxx<10.0" -c conda-forge |
|
mamba install -y -c "nvidia/label/cuda-11.8.0" cuda-toolkit cuda-nvcc cuda-cudart |
|
|
|
export PATH=${CONDA_HOME}/envs/${ENV_NAME}/bin:$PATH |
|
export LD_LIBRARY_PATH=${CONDA_HOME}/envs/${ENV_NAME}/lib:$LD_LIBRARY_PATH |
|
export CUDA_HOME=${CONDA_HOME}/envs/${ENV_NAME} |
|
|
|
|
|
mamba install -y pytorch torchvision torchaudio pytorch-cuda=11.8 \ |
|
-c pytorch -c nvidia |
|
|
|
|
|
pip install ninja packaging |
|
rm -rf .apex && git clone https://github.com/NVIDIA/apex .apex |
|
cd .apex |
|
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation \ |
|
--config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" ./ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cd $DIR |
|
pip install --upgrade pip |
|
pip install --no-build-isolation flash-attn |
|
pip install -r /mnt/cephfs-nvme/jpombal/multilinguality_megatron/setup/pip_reps.txt |
|
|
|
conda env config vars set PATH=$PATH |
|
conda env config vars set LD_LIBRARY_PATH=$LD_LIBRARY_PATH |
|
conda env config vars set CUDA_HOME=$CUDA_HOME |