-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update dockerfile to allow incremental builds and change TRTLLM…
… error to point to dockerfile (#290) Signed-off-by: Terry Kong <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
cd088f4
commit 3c35440
Showing
3 changed files
with
37 additions
and
18 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
# To build NeMo-Aligner from a base PyTorch container: | ||
# | ||
# docker buildx build -t aligner:latest . | ||
# | ||
# To update NeMo-Aligner from a pre-built NeMo-Framework container: | ||
# | ||
# docker buildx build --target=aligner-bump --build-arg=BASE_IMAGE=nvcr.io/nvidia/nemo:24.07 -t aligner:latest . | ||
# | ||
|
||
# Number of parallel threads for compute heavy build jobs | ||
# if you get errors building TE or Apex, decrease this to 4 | ||
ARG MAX_JOBS=8 | ||
|
@@ -12,16 +21,33 @@ ARG PROTOBUF_VERSION=4.24.4 | |
|
||
ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:24.03-py3 | ||
|
||
FROM ${BASE_IMAGE} | ||
|
||
ARG MAX_JOBS | ||
FROM ${BASE_IMAGE} AS aligner-bump | ||
|
||
# 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 "[email protected]" | ||
ARG ALIGNER_COMMIT | ||
|
||
WORKDIR /opt | ||
|
||
# NeMo Aligner | ||
RUN <<"EOF" bash -exu | ||
if [[ ! -d NeMo-Aligner ]]; then | ||
git clone https://github.com/NVIDIA/NeMo-Aligner.git | ||
cd NeMo-Aligner | ||
git checkout $ALIGNER_COMMIT | ||
pip install --no-deps -e . | ||
cd - | ||
fi | ||
cd NeMo-Aligner | ||
git fetch -a | ||
git checkout -f ${ALIGNER_COMMIT} | ||
git pull | ||
EOF | ||
|
||
FROM aligner-bump as final | ||
|
||
# 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 "[email protected]" | ||
# install TransformerEngine | ||
ARG MAX_JOBS | ||
ARG TE_TAG | ||
RUN pip uninstall -y transformer-engine && \ | ||
git clone https://github.com/NVIDIA/TransformerEngine.git && \ | ||
|
@@ -76,17 +102,6 @@ RUN pip uninstall -y megatron-core && \ | |
fi && \ | ||
pip install -e . | ||
|
||
# NeMo Aligner | ||
ARG ALIGNER_COMMIT | ||
RUN git clone https://github.com/NVIDIA/NeMo-Aligner.git && \ | ||
cd NeMo-Aligner && \ | ||
git pull && \ | ||
if [ ! -z $ALIGNER_COMMIT ]; then \ | ||
git fetch origin $ALIGNER_COMMIT && \ | ||
git checkout FETCH_HEAD; \ | ||
fi && \ | ||
pip install --no-deps -e . | ||
|
||
# Git LFS | ||
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ | ||
apt-get install git-lfs && \ | ||
|
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