1515# # Global Args #################################################################
1616# # If the nvcr container is updated, ensure to check the torch and python
1717# # installation version inside the dockerfile before pushing changes.
18- ARG NVCR_IMAGE_VERSION=25.02 -py3
18+ ARG NVCR_IMAGE_VERSION=25.10 -py3
1919
2020# This is based on what is inside the NVCR image already
2121ARG PYTHON_VERSION=3.12
@@ -28,58 +28,26 @@ ARG USER_UID=0
2828ARG WORKDIR=/app
2929ARG SOURCE_DIR=${WORKDIR}/fms-hf-tuning
3030
31- ARG ENABLE_FMS_ACCELERATION=true
32- ARG ENABLE_AIM=false
33- ARG ENABLE_MLFLOW=false
34- ARG ENABLE_SCANNER=false
35- ARG ENABLE_CLEARML=true
3631ARG ENABLE_TRITON_KERNELS=true
37- ARG ENABLE_RECOMMENDER=true
3832
3933# Ensures to always build mamba_ssm from source
4034ENV PIP_NO_BINARY=mamba-ssm,mamba_ssm
4135
42- # upgrade torch as the base layer contains only torch 2.7
43- RUN python -m pip install --upgrade pip && \
44- pip install --upgrade setuptools && \
45- pip install --upgrade --force-reinstall torch torchaudio torchvision --index-url https://download.pytorch.org/whl/cu128
36+ # install triton kernels
37+ RUN pip install --no-cache-dir "git+https://github.com/triton-lang/triton.git@main#subdirectory=python/triton_kernels"
4638
4739# Install main package + flash attention
4840COPY . ${SOURCE_DIR}
4941RUN cd ${SOURCE_DIR}
5042
51- RUN pip install --no-cache-dir ${SOURCE_DIR} && \
52- pip install --no-cache-dir --no-build-isolation ${SOURCE_DIR}[flash-attn] && \
53- pip install --no-cache-dir --no-build-isolation ${SOURCE_DIR}[mamba]
54-
55- # Optional extras
56- RUN if [[ "${ENABLE_FMS_ACCELERATION}" == "true" ]]; then \
57- pip install --no-cache-dir ${SOURCE_DIR}[fms-accel] && \
58- python -m fms_acceleration.cli install fms_acceleration_peft && \
59- python -m fms_acceleration.cli install fms_acceleration_foak && \
60- python -m fms_acceleration.cli install fms_acceleration_aadp && \
61- python -m fms_acceleration.cli install fms_acceleration_moe && \
62- python -m fms_acceleration.cli install fms_acceleration_odm; \
63- fi
64-
65- RUN if [[ "${ENABLE_TRITON_KERNELS}" == "true" ]]; then \
66- pip install --no-cache-dir "git+https://github.com/triton-lang/triton.git@main#subdirectory=python/triton_kernels" ; \
67- fi
68- RUN if [[ "${ENABLE_CLEARML}" == "true" ]]; then \
69- pip install --no-cache-dir ${SOURCE_DIR}[clearml]; \
70- fi
71- RUN if [[ "${ENABLE_AIM}" == "true" ]]; then \
72- pip install --no-cache-dir ${SOURCE_DIR}[aim]; \
73- fi
74- RUN if [[ "${ENABLE_MLFLOW}" == "true" ]]; then \
75- pip install --no-cache-dir ${SOURCE_DIR}[mlflow]; \
76- fi
77- RUN if [[ "${ENABLE_SCANNER}" == "true" ]]; then \
78- pip install --no-cache-dir ${SOURCE_DIR}[scanner-dev]; \
79- fi
80- RUN if [[ "${ENABLE_RECOMMENDER}" == "true" ]]; then \
81- pip install --no-cache-dir ${SOURCE_DIR}[tuning_config_recommender]; \
82- fi
43+ RUN pip install --no-cache-dir ${SOURCE_DIR}[flash-attn,mamba,fms-accel,clearml,tuning_config_recommender]
44+
45+ # install fms-accel packages
46+ RUN python -m fms_acceleration.cli install fms_acceleration_peft && \
47+ python -m fms_acceleration.cli install fms_acceleration_foak && \
48+ python -m fms_acceleration.cli install fms_acceleration_aadp && \
49+ python -m fms_acceleration.cli install fms_acceleration_moe && \
50+ python -m fms_acceleration.cli install fms_acceleration_odm
8351
8452# cleanup build artifacts and caches
8553RUN rm -rf /root/.cache /tmp/pip-* \
@@ -141,4 +109,6 @@ ENV TRITON_DUMP_DIR="/tmp/triton_dump_dir"
141109ENV TRITON_CACHE_DIR="/tmp/triton_cache_dir"
142110ENV TRITON_OVERRIDE_DIR="/tmp/triton_override_dir"
143111
144- CMD ["python" , "/app/accelerate_launch.py" ]
112+ RUN pip install -U accelerate
113+
114+ CMD ["python" , "/app/accelerate_launch.py" ]
0 commit comments