-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Egert <degert@nvidia.com> Signed-off-by: Gerald Shen <geshen@nvidia.com> Co-authored-by: trias702 <daniel.egert@gmail.com>
- Loading branch information
Showing
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# CUDA 12.2 | ||
FROM nvcr.io/nvidia/pytorch:23.10-py3 | ||
|
||
### config tags | ||
ARG APEX_TAG=master | ||
ARG TE_TAG=release_v1.1 | ||
ARG MLM_TAG=core_r0.4.0 | ||
ARG NEMO_TAG=r1.22.0 | ||
ARG PYTRITON_VERSION=0.4.1 | ||
ARG PROTOBUF_VERSION=4.24.4 | ||
|
||
# if you get errors building TE or Apex, decrease this to 4 | ||
ARG MAX_JOBS=8 | ||
|
||
# needed in case git complains that it can't detect a valid email, this email is fake but works | ||
RUN git config --global user.email "worker@nvidia.com" | ||
|
||
WORKDIR /opt | ||
|
||
# install TransformerEngine | ||
RUN pip uninstall -y transformer-engine && \ | ||
git clone https://github.com/NVIDIA/TransformerEngine.git && \ | ||
cd TransformerEngine && \ | ||
if [ ! -z $TE_TAG ]; then \ | ||
git fetch origin $TE_TAG && \ | ||
git checkout FETCH_HEAD; \ | ||
fi && \ | ||
git submodule init && git submodule update && \ | ||
NVTE_FRAMEWORK=pytorch NVTE_WITH_USERBUFFERS=1 MPI_HOME=/usr/local/mpi pip install . | ||
|
||
# install latest apex | ||
RUN pip uninstall -y apex && \ | ||
git clone https://github.com/NVIDIA/apex && \ | ||
cd apex && \ | ||
if [ ! -z $APEX_TAG ]; then \ | ||
git fetch origin $APEX_TAG && \ | ||
git checkout FETCH_HEAD; \ | ||
fi && \ | ||
pip install install -v --no-build-isolation --disable-pip-version-check --no-cache-dir --config-settings "--build-option=--cpp_ext --cuda_ext --fast_layer_norm --distributed_adam --deprecated_fused_adam" ./ | ||
|
||
# place any util pkgs here | ||
RUN pip install --upgrade-strategy only-if-needed nvidia-pytriton==$PYTRITON_VERSION | ||
RUN pip install -U --no-deps protobuf==$PROTOBUF_VERSION | ||
RUN pip install --upgrade-strategy only-if-needed jsonlines | ||
|
||
# NeMo | ||
RUN git clone https://github.com/NVIDIA/NeMo.git && \ | ||
cd NeMo && \ | ||
git pull && \ | ||
if [ ! -z $NEMO_TAG ]; then \ | ||
git fetch origin $NEMO_TAG && \ | ||
git checkout FETCH_HEAD; \ | ||
fi && \ | ||
pip uninstall -y nemo_toolkit sacrebleu && \ | ||
git cherry-pick --no-commit -X theirs fa8d416793d850f4ce56bea65e1fe28cc0d092c0 a7f0bc1903493888c31436efc2452ff721fa5a67 && \ | ||
sed -i 's/shutil.rmtree(ckpt_to_dir(filepath))/shutil.rmtree(ckpt_to_dir(filepath), ignore_errors=True)/g' nemo/collections/nlp/parts/nlp_overrides.py && \ | ||
rm -rf .git && pip install -e ".[nlp]" && \ | ||
cd nemo/collections/nlp/data/language_modeling/megatron && make | ||
|
||
# MLM | ||
RUN pip uninstall -y megatron-core && \ | ||
git clone https://github.com/NVIDIA/Megatron-LM.git && \ | ||
cd Megatron-LM && \ | ||
git pull && \ | ||
if [ ! -z $MLM_TAG ]; then \ | ||
git fetch origin $MLM_TAG && \ | ||
git checkout FETCH_HEAD; \ | ||
fi && \ | ||
pip install -e . | ||
|
||
WORKDIR /opt | ||
|
||
# install the latest NeMo-Aligner | ||
RUN pip install --no-deps git+https://github.com/NVIDIA/NeMo-Aligner.git@main | ||
|
||
WORKDIR /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters