Skip to content

Commit

Permalink
Merge branch 'ko3n1g/build/caching' into 'main'
Browse files Browse the repository at this point in the history
build: Improve caching

See merge request ADLR/megatron-lm!2406
  • Loading branch information
ko3n1g committed Nov 28, 2024
2 parents 3c2d6f8 + 39f3bef commit f3e1afb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions Dockerfile.ci.dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ RUN apt-get update && \
wget https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 -O /usr/local/bin/yq && \
chmod a+x /usr/local/bin/yq

COPY --from=build_causal_conv1d /opt/causal_conv1d-*.whl ./
COPY --from=build_grouped_gemm /opt/grouped_gemm-*.whl ./
COPY --from=build_mamba_ssm /opt/mamba_ssm-*.whl ./

RUN pip install causal_conv1d-*.whl \
mamba_ssm-*.whl \
grouped_gemm-*.whl

# Since megatron does not have any dependencies (and isn't a dependency to any other package), we can install it separately to make everything a bit quicker
ARG MCORE_REPO
ARG MCORE_REF
Expand All @@ -47,14 +55,6 @@ git checkout $MCORE_BACKWARDS_REF
rm -rf megatron; cp -a /opt/megatron-lm/megatron ./
EOF

COPY --from=build_causal_conv1d /opt/causal_conv1d-*.whl ./
COPY --from=build_grouped_gemm /opt/grouped_gemm-*.whl ./
COPY --from=build_mamba_ssm /opt/mamba_ssm-*.whl ./

RUN pip install causal_conv1d-*.whl \
mamba_ssm-*.whl \
grouped_gemm-*.whl

RUN PY_ENV=pytorch:24.07 pip install -e /opt/megatron-lm
ENV PYTHONPATH="/opt/megatron-lm:$PYTHONPATH"
ENV NVTE_FLASH_ATTN=0
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile.ci.lts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ RUN apt-get update && \
wget https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 -O /usr/local/bin/yq && \
chmod a+x /usr/local/bin/yq

COPY --from=build_causal_conv1d /opt/causal_conv1d-*.whl ./
COPY --from=build_grouped_gemm /opt/grouped_gemm-*.whl ./
COPY --from=build_mamba_ssm /opt/mamba_ssm-*.whl ./

RUN pip install causal_conv1d-*.whl \
mamba_ssm-*.whl \
grouped_gemm-*.whl

# Since megatron does not have any dependencies (and isn't a dependency to any other package), we can install it separately to make everything a bit quicker
ARG MCORE_REPO
ARG MCORE_REF
Expand All @@ -48,14 +56,6 @@ git checkout $MCORE_BACKWARDS_REF
rm -rf megatron; cp -a /opt/megatron-lm/megatron ./
EOF

COPY --from=build_causal_conv1d /opt/causal_conv1d-*.whl ./
COPY --from=build_grouped_gemm /opt/grouped_gemm-*.whl ./
COPY --from=build_mamba_ssm /opt/mamba_ssm-*.whl ./

RUN pip install causal_conv1d-*.whl \
mamba_ssm-*.whl \
grouped_gemm-*.whl

RUN PY_ENV=pytorch:24.01 \
CAUSAL_CONV1D_FORCE_BUILD=TRUE \
MAMBA_FORCE_BUILD=TRUE \
Expand Down

0 comments on commit f3e1afb

Please sign in to comment.