16
16
17
17
ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:24.07-py3
18
18
19
- FROM ${BASE_IMAGE} as nemo-bump
20
- ARG NEMO_TAG
21
- WORKDIR /opt
22
- # NeMo
23
- RUN <<"EOF" bash -exu
24
- if [[ ! -d NeMo ]]; then
25
- git clone https://github.com/NVIDIA/NeMo.git
26
- fi
27
- cd NeMo/
28
- git fetch origin '+refs/pull/*/merge:refs/remotes/pull/*/merge'
29
- git fetch origin $NEMO_TAG
30
- git checkout -f $NEMO_TAG
31
- EOF
32
-
33
-
34
19
FROM ${BASE_IMAGE} AS trt-base
35
20
ARG IMAGE_LABEL
36
21
LABEL "nemo.library"=${IMAGE_LABEL}
48
33
49
34
ARG TRTLLM_REPO
50
35
ARG TRTLLM_TAG
51
- RUN --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ reinstall.sh,target=/tmp/NeMo/reinstall.sh <<"EOF" bash -ex
36
+ RUN --mount=type=bind,source=reinstall.sh,target=/tmp/NeMo/reinstall.sh <<"EOF" bash -ex
52
37
53
38
bash /tmp/NeMo/reinstall.sh --library trt --mode install
54
39
EOF
@@ -58,17 +43,17 @@ FROM trt-base AS trt-llm-wheel
58
43
59
44
ARG TRTLLM_REPO
60
45
ARG TRTLLM_TAG
61
- RUN --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ reinstall.sh,target=/tmp/NeMo/reinstall.sh <<"EOF" bash -ex
46
+ RUN --mount=type=bind,source=reinstall.sh,target=/tmp/NeMo/reinstall.sh <<"EOF" bash -ex
62
47
63
48
bash /tmp/NeMo/reinstall.sh --library trtllm --mode build
64
49
EOF
65
50
66
51
67
- FROM trt-base AS test-image
52
+ FROM trt-base as final
68
53
69
54
ARG MLM_REPO
70
55
ARG MLM_TAG
71
- RUN --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ reinstall.sh,target=/tmp/NeMo/reinstall.sh <<"EOF" bash -ex
56
+ RUN --mount=type=bind,source=reinstall.sh,target=/tmp/NeMo/reinstall.sh <<"EOF" bash -ex
72
57
73
58
bash /tmp/NeMo/reinstall.sh --library mcore --mode build
74
59
ls -al /tmp/Megatron-LM || true
77
62
WORKDIR /workspace
78
63
RUN \
79
64
--mount=type=bind,from=trt-llm-wheel,source=/opt/wheels/trtllm,target=/opt/wheels/trtllm \
80
- --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ requirements,target=/tmp/NeMo/requirements \
81
- --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ tools/ctc_segmentation/requirements.txt,target=/tmp/NeMo/tools/ctc_segmentation/requirements.txt \
82
- --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ reinstall.sh,target=/tmp/NeMo/reinstall.sh \
83
- --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ setup.py,target=/tmp/NeMo/setup.py \
84
- --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ README.md,target=/tmp/NeMo/README.md \
85
- --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ nemo/package_info.py,target=/tmp/NeMo/nemo/package_info.py \
86
- --mount=type=bind,from=nemo-bump, source=/opt/NeMo/ nemo/__init__.py,target=/tmp/NeMo/nemo/__init__.py <<"EOF" bash -ex
65
+ --mount=type=bind,source=requirements,target=/tmp/NeMo/requirements \
66
+ --mount=type=bind,source=tools/ctc_segmentation/requirements.txt,target=/tmp/NeMo/tools/ctc_segmentation/requirements.txt \
67
+ --mount=type=bind,source=reinstall.sh,target=/tmp/NeMo/reinstall.sh \
68
+ --mount=type=bind,source=setup.py,target=/tmp/NeMo/setup.py \
69
+ --mount=type=bind,source=README.md,target=/tmp/NeMo/README.md \
70
+ --mount=type=bind,source=nemo/package_info.py,target=/tmp/NeMo/nemo/package_info.py \
71
+ --mount=type=bind,source=nemo/__init__.py,target=/tmp/NeMo/nemo/__init__.py <<"EOF" bash -ex
87
72
88
73
bash /tmp/NeMo/reinstall.sh --library all --mode install
89
74
rm -rf $NEMO_DIR || true
90
75
EOF
91
76
92
- # Copy over NeMo code
93
- ARG NEMO_REPO
94
- ARG NEMO_TAG
95
- RUN \
96
- --mount=type=bind,from=nemo-bump,source=/opt/NeMo/reinstall.sh,target=/tmp/reinstall.sh <<"EOF" bash -ex
97
-
98
- bash /tmp/reinstall.sh --library all --mode install
99
-
100
- # Copy into workspace
101
- cp -a /opt/NeMo/. /workspace/
102
- cp -r /opt/Megatron-LM/ /workspace/
103
-
104
- # set permission
105
- chmod 777 -R /workspace
106
- EOF
107
77
108
78
ENV PYTHONPATH="${PYTHONPATH}:/workspace/Megatron-LM"
109
79
ENV NEMO_HOME="/home/TestData/nemo_home"
0 commit comments