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.10 -py3
18+ ARG NVCR_IMAGE_VERSION=25.02 -py3
1919
2020# This is based on what is inside the NVCR image already
2121ARG PYTHON_VERSION=3.12
@@ -28,26 +28,58 @@ 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
3136ARG ENABLE_TRITON_KERNELS=true
37+ ARG ENABLE_RECOMMENDER=true
3238
3339# Ensures to always build mamba_ssm from source
3440ENV PIP_NO_BINARY=mamba-ssm,mamba_ssm
3541
36- # install triton kernels
37- RUN pip install --no-cache-dir "git+https://github.com/triton-lang/triton.git@main#subdirectory=python/triton_kernels"
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
3846
3947# Install main package + flash attention
4048COPY . ${SOURCE_DIR}
4149RUN cd ${SOURCE_DIR}
4250
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
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
5183
5284# cleanup build artifacts and caches
5385RUN rm -rf /root/.cache /tmp/pip-* \
0 commit comments