Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile using Nvidia Container Toolkit #409

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions DEV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DEV.md

docker build -t niccolox/nanogpt:0.1 .

docker run -it --runtime=nvidia --gpus all niccolox/nanogpt:0.1

nvidia-smi

python3 data/shakespeare_char/prepare.py
python3 train.py config/train_shakespeare_char.py
python3 sample.py --out_dir=out-shakespeare-char

python3 data/openwebtext/prepare.py
torchrun --standalone --nproc_per_node=8 train.py config/train_gpt2.py
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# derived from https://github.com/h2oai/h2ogpt/blob/main/Dockerfile

# runs in Dockers running on host with Nvidia Container Toolkit

# docker build -t niccolox/nanogpt:0.1 .

# docker run -it --runtime=nvidia --gpus all niccolox/nanogpt:0.1

# nvidia-smi

FROM nvidia/cuda:12.0.1-cudnn8-devel-ubuntu20.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
software-properties-common \
curl \
git \
python3 \
python3-pip \
python3-dev \
vim \
wget && \
pip3 install --upgrade wheel setuptools && \
pip3 install --upgrade pip

COPY . /workspace/
WORKDIR /workspace

#RUN pip install -r requirements.txt
RUN pip install torch numpy transformers datasets tiktoken wandb tqdm

RUN chmod -R a+rwx /workspace

RUN python3 data/shakespeare_char/prepare.py
# RUN python3 train.py config/train_shakespeare_char.py
# RUN python3 sample.py --out_dir=out-shakespeare-char

# RUN python3 data/openwebtext/prepare.py
# RUN torchrun --standalone --nproc_per_node=8 train.py config/train_gpt2.py