forked from mlcommons/training
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (43 loc) · 1.83 KB
/
Dockerfile
File metadata and controls
49 lines (43 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM nvcr.io/nvidia/pytorch:24.09-py3
WORKDIR /app
ARG NEMO_REVISION=7f3da35e1
RUN git clone https://github.com/NVIDIA/NeMo.git && \
rm -rf /opt/NeMo && \
cd NeMo && \
git checkout ${NEMO_REVISION} && \
sed -i "/mamba-ssm/d" requirements/requirements_nlp.txt && \
sed -i 's/tensorstore<0.1.46/tensorstore/g' requirements/requirements_nlp.txt && \
sed -i "/triton>=3.1.0/d" requirements/requirements.txt && \
pip install --no-build-isolation -e ".[nlp]"
# ## Megatron-core
ARG MCORE_REVISION=a616d459039ae103257f6a20922261ac11ccbdf6
RUN pip uninstall -y megatron-core && \
rm -rf /opt/megatron-lm && \
git clone https://github.com/NVIDIA/Megatron-LM.git && \
cd Megatron-LM && \
git checkout ${MCORE_REVISION} && \
echo MCORE_COMMIT_HASH=$(git rev-parse HEAD) && \
pip install . && \
cd megatron/core/datasets && \
make
ENV PYTHONPATH "${PYTHONPATH}:/app/Megatron-LM"
RUN pip install git+https://github.com/NVIDIA/dllogger#egg=dllogger
RUN pip install datasets==2.20.0 hydra-core sentencepiece
RUN pip install "git+https://github.com/mlperf/logging.git"
RUN pip install git+https://github.com/NVIDIA/NeMo-Run.git
WORKDIR /app/training
ADD . /app/training
RUN patch --directory=/app/Megatron-LM -p1 < docker/gpu/megatron_core.patch