Skip to content
Merged
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
16 changes: 14 additions & 2 deletions small_llm_pretraining/nemo/Dockerfile.b200
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,23 @@ ENV CUSTOM_FROM_IMAGE_NAME ${FROM_IMAGE_NAME}
# Custom libraries version
WORKDIR /workspace/

ENV PIP_CONSTRAINT=""

RUN git config --global user.name "a" && \
git config --global user.email "a"

WORKDIR /workspace/

# Freeze the NGC base image's torch stack so later pip installs can't downgrade it.
# The base image ships custom NGC builds of torch/torchvision/torchaudio with
# matching transformer_engine .so files; any version change breaks the ABI.
RUN python3 -c "\
import importlib, sys; \
pkgs = ['torch', 'torchvision', 'torchaudio']; \
lines = []; \
[lines.append(f'{p}=={importlib.import_module(p).__version__}') for p in pkgs if importlib.util.find_spec(p)]; \
open('/pip_torch_constraint.txt','w').write('\n'.join(lines)+'\n'); \
print('--- Pinned torch packages ---'); [print(l) for l in lines]"
ENV PIP_CONSTRAINT=/pip_torch_constraint.txt

RUN pip install numcodecs==0.13.1

## 3. NeMo
Expand Down Expand Up @@ -95,6 +105,8 @@ RUN if [ "${MCORE_REVISION}" != SKIP ]; then \

ENV PYTHONPATH "${PYTHONPATH}:/workspace/Megatron-LM"

# Clear the torch constraint now that all installs are done.
ENV PIP_CONSTRAINT=""

WORKDIR /workspace/code

Expand Down
14 changes: 14 additions & 0 deletions small_llm_pretraining/nemo/Dockerfile.h200
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ RUN git config --global user.name "a" && \

WORKDIR /workspace/

# Freeze the NGC base image's torch stack so later pip installs can't downgrade it.
# The base image ships custom NGC builds of torch/torchvision/torchaudio with
# matching transformer_engine .so files; any version change breaks the ABI.
RUN python3 -c "\
import importlib, sys; \
pkgs = ['torch', 'torchvision', 'torchaudio']; \
lines = []; \
[lines.append(f'{p}=={importlib.import_module(p).__version__}') for p in pkgs if importlib.util.find_spec(p)]; \
open('/pip_torch_constraint.txt','w').write('\n'.join(lines)+'\n'); \
print('--- Pinned torch packages ---'); [print(l) for l in lines]"
ENV PIP_CONSTRAINT=/pip_torch_constraint.txt

RUN pip install numcodecs==0.13.1

## 1. Apex
Expand Down Expand Up @@ -127,6 +139,8 @@ RUN if [ "${MCORE_REVISION}" != SKIP ]; then \

ENV PYTHONPATH "${PYTHONPATH}:/workspace/Megatron-LM"

# Clear the torch constraint now that all installs are done.
ENV PIP_CONSTRAINT=""

WORKDIR /workspace/code

Expand Down
Loading