ai-forever / ru-gpts

Russian GPT3 models.
Apache License 2.0
2.08k stars 444 forks source link

Docker container request #7

Closed dilyararimovna closed 3 years ago

dilyararimovna commented 3 years ago

Hello!

It would be very helpful if you build and release docker containers with the models.

Thank you in advance.

king-menin commented 3 years ago

we do not plan. sorry

denismashukov commented 3 years ago

if still relevant, you can user aws ec2 instance g4dn.xlarge with ubuntu:21.10

1) instace with GPU

sudo apt update
sudo apt install -y --no-install-recommends git unzip wget
sudo apt install -y --no-install-recommends python3-dev python3-pip python3-setuptools

2) Install AWS CLI

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install

3) Install NVIDIA gaming driver

2.1) Install nvidia-docker2 if you use docker container

4) ruGPT-3 work with Torch v1.7.1 For this version we need to install CUDA 11.0. Install CUDA Toolkit 11.0

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda-repo-ubuntu2004-11-0-local_11.0.2-450.51.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-0-local_11.0.2-450.51.05-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-0-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

5) Install Torch v1.7.1

pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

6) Install dependencies for ru-gpt

pip3 -q install pip --upgrade
pip3 install jupyter numpy pandas \
    tensorboard transformers==3.5.0 deepspeed

6) Install apex

git clone https://github.com/NVIDIA/apex
cd apex
pip3 install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
LEv145 commented 1 year ago

Like that:

FROM nvcr.io/nvidia/pytorch:22.02-py3

# Apex
WORKDIR /tmp/unique_for_apex
RUN git clone https://github.com/NVIDIA/apex
WORKDIR /tmp/unique_for_apex/apex
RUN pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .

WORKDIR /opt/
RUN git clone https://github.com/sberbank-ai/ru-gpts
WORKDIR /opt/ru-gpts
RUN pip install -r requirements.txt
RUN DS_BUILD_CPU_ADAM=1 DS_BUILD_SPARSE_ATTN=1 pip install deepspeed
RUN pip install transformers==4.26.1
LEv145 commented 1 year ago

https://github.com/LEv145/rugpt-docker-compose