Skip to content

Commit 177a67f

Browse files
github-actions[bot]ericharperaklife97
authored
Update Apex install command in Dockerfile (#7794) (#7804)
* move core install to /workspace (#7706) * update apex install in dockerfile * use fetch head --------- Signed-off-by: Abhinav Khattar <[email protected]> Signed-off-by: eharper <[email protected]> Co-authored-by: Eric Harper <[email protected]> Co-authored-by: Abhinav Khattar <[email protected]>
1 parent 2c28582 commit 177a67f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Dockerfile

+16-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,27 @@ RUN git clone https://github.com/NVIDIA/Megatron-LM.git && \
4949
git checkout ab0336a5c8eab77aa74ae604ba1e73decbf6d560 && \
5050
pip install -e .
5151

52-
WORKDIR /tmp/
52+
# Install megatron core, this can be removed once 0.3 pip package is released
53+
# We leave it here in case we need to work off of a specific commit in main
54+
RUN git clone https://github.com/NVIDIA/Megatron-LM.git && \
55+
cd Megatron-LM && \
56+
git checkout 375395c187ff64b8d56a1cd40572bc779864b1bd && \
57+
pip install .
5358

5459
# Distributed Adam support for multiple dtypes
5560
RUN git clone https://github.com/NVIDIA/apex.git && \
5661
cd apex && \
5762
git checkout 52e18c894223800cb611682dce27d88050edf1de && \
58-
pip3 install -v --no-build-isolation --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--fast_layer_norm" --global-option="--distributed_adam" --global-option="--deprecated_fused_adam" ./
63+
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" ./
64+
65+
RUN git clone https://github.com/NVIDIA/TransformerEngine.git && \
66+
cd TransformerEngine && \
67+
git fetch origin a03f8bc9ae004e69aae4902fdd4a6d81fd95bc89 && \
68+
git checkout FETCH_HEAD && \
69+
git submodule init && git submodule update && \
70+
NVTE_FRAMEWORK=pytorch NVTE_WITH_USERBUFFERS=1 MPI_HOME=/usr/local/mpi pip install .
71+
72+
WORKDIR /tmp/
5973

6074
# uninstall stuff from base container
6175
RUN pip3 uninstall -y sacrebleu torchtext

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ To install Apex, run
280280
git clone https://github.com/NVIDIA/apex.git
281281
cd apex
282282
git checkout 52e18c894223800cb611682dce27d88050edf1de
283-
pip install -v --no-build-isolation --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--fast_layer_norm" --global-option="--distributed_adam" --global-option="--deprecated_fused_adam" ./
283+
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" ./
284284
285285
It is highly recommended to use the NVIDIA PyTorch or NeMo container if having issues installing Apex or any other dependencies.
286286

0 commit comments

Comments
 (0)