forked from NVlabs/VILA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvironment_setup.sh
executable file
·37 lines (28 loc) · 1.22 KB
/
environment_setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -e
CONDA_ENV=${1:-""}
if [ -n "$CONDA_ENV" ]; then
# This is required to activate conda environment
eval "$(conda shell.bash hook)"
conda create -n $CONDA_ENV python=3.10.14 -y
conda activate $CONDA_ENV
# This is optional if you prefer to use built-in nvcc
conda install -c nvidia cuda-toolkit -y
else
echo "Skipping conda environment creation. Make sure you have the correct environment activated."
fi
# This is required to enable PEP 660 support
pip install --upgrade pip setuptools
# Install FlashAttention2
pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.5.8/flash_attn-2.5.8+cu122torch2.3cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
# Install VILA
pip install -e ".[train,eval]"
# Quantization requires the newest triton version, and introduce dependency issue
pip install triton==3.1.0
# numpy introduce a lot dependencies issues, separate from pyproject.yaml
# pip install numpy==1.26.4
# Replace transformers and deepspeed files
site_pkg_path=$(python -c 'import site; print(site.getsitepackages()[0])')
cp -rv ./llava/train/deepspeed_replace/* $site_pkg_path/deepspeed/
# Downgrade protobuf to 3.20 for backward compatibility
pip install protobuf==3.20.*