Skip to content

Commit

Permalink
rm needless kmod/libnccl2 && rm needless build from source for triton…
Browse files Browse the repository at this point in the history
…/causal-conv1d/mamba/flashinfer/bitsandbytes
  • Loading branch information
cennn committed Dec 16, 2024
1 parent 600b805 commit d5d2911
Showing 1 changed file with 2 additions and 44 deletions.
46 changes: 2 additions & 44 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
&& echo 'tzdata tzdata/Zones/America select Los_Angeles' | debconf-set-selections \
&& apt-get update -y \
&& apt-get install -y ccache software-properties-common git curl sudo kmod \
&& apt-get install -y ccache software-properties-common git curl sudo \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update -y \
&& apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \
Expand Down Expand Up @@ -125,47 +125,6 @@ RUN --mount=type=cache,target=/root/.cache/ccache \
python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
fi

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=.git,target=.git \
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
apt-get update && apt-get install zlib1g-dev && \
python3 -m pip install packaging pybind11 && \
git clone https://github.com/openai/triton && \
cd triton/python && \
git submodule update --init --recursive && \
pip --verbose wheel --use-pep517 --no-deps -w /workspace/dist --no-build-isolation --no-cache-dir . ; \
fi

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=.git,target=.git \
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
CAUSAL_CONV1D_FORCE_BUILD=TRUE CAUSAL_CONV1D_SKIP_CUDA_BUILD=FALSE pip --verbose wheel --use-pep517 --no-deps -w /workspace/dist --no-build-isolation --no-cache-dir git+https://github.com/Dao-AILab/causal-conv1d.git ; \
fi

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=.git,target=.git \
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
MAMBA_FORCE_BUILD=TRUE pip --verbose wheel --use-pep517 --no-deps -w /workspace/dist --no-build-isolation --no-cache-dir git+https://github.com/state-spaces/mamba.git ; \
fi

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=.git,target=.git \
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
apt-get update && apt-get install -y cuda-toolkit-12-4 && \
git clone -b v0.1.6 https://github.com/flashinfer-ai/flashinfer.git --recursive && \
cd flashinfer/python && \
pip --verbose wheel --use-pep517 --no-deps -w /workspace/dist --no-build-isolation --no-cache-dir . ; \
fi

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=.git,target=.git \
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
git clone -b 0.44.1 https://github.com/bitsandbytes-foundation/bitsandbytes.git && \
cd bitsandbytes && \
pip --verbose wheel --use-pep517 --no-deps -w /workspace/dist --no-build-isolation --no-cache-dir . ; \
fi


# Check the size of the wheel if RUN_WHEEL_CHECK is true
COPY .buildkite/check-wheel-size.py check-wheel-size.py
# Default max size of the wheel is 250MB
Expand All @@ -177,7 +136,6 @@ RUN if [ "$RUN_WHEEL_CHECK" = "true" ]; then \
else \
echo "Skipping wheel size check."; \
fi

#################### EXTENSION Build IMAGE ####################

#################### DEV IMAGE ####################
Expand Down Expand Up @@ -208,7 +166,7 @@ RUN PYTHON_VERSION_STR=$(echo ${PYTHON_VERSION} | sed 's/\.//g') && \
RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
&& echo 'tzdata tzdata/Zones/America select Los_Angeles' | debconf-set-selections \
&& apt-get update -y \
&& apt-get install -y ccache software-properties-common git curl sudo vim python3-pip libnccl2\
&& apt-get install -y ccache software-properties-common git curl sudo vim python3-pip \
&& apt-get install -y ffmpeg libsm6 libxext6 libgl1 \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update -y \
Expand Down

0 comments on commit d5d2911

Please sign in to comment.