2024-08-28 15:34:31 +02:00
|
|
|
ARG ROCM_VERSION=6.1.2
|
2024-08-28 16:08:40 +02:00
|
|
|
FROM rocm/dev-ubuntu-22.04:${ROCM_VERSION}
|
2024-08-28 16:02:15 +02:00
|
|
|
# also works without -complete for specific arch (tested on gfx1030)
|
2024-08-28 10:38:31 +02:00
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
2024-08-28 15:15:02 +02:00
|
|
|
PYTHONIOENCODING=UTF-8
|
2024-08-28 15:13:16 +02:00
|
|
|
|
|
|
|
# For bitsandbytes
|
|
|
|
ENV BNB_GPU_TARGETS="gfx803;gfx900;gfx906;gfx908;gfx90a;gfx1010;gfx1030;gfx1100;gfx1101;gfx1102"
|
|
|
|
# For LLAMA
|
2024-08-29 12:05:53 +02:00
|
|
|
#ARG ROCM_DOCKER_ARCH=\
|
|
|
|
# gfx803 \
|
|
|
|
# gfx900 \
|
|
|
|
# gfx906 \
|
|
|
|
# gfx908 \
|
|
|
|
# gfx90a \
|
|
|
|
# gfx1010 \
|
|
|
|
# gfx1030 \
|
|
|
|
# gfx1100 \
|
|
|
|
# gfx1101 \
|
|
|
|
# gfx1102
|
|
|
|
ARG ROCM_DOCKER_ARCH="gfx803 gfx 900 gfx906 gfx908 gfx90a gfx1010 gfx1030 gfx1100 gfx1101 gfx1102"
|
2024-08-28 16:08:09 +02:00
|
|
|
ENV GPU_TARGETS=${ROCM_DOCKER_ARCH}
|
2024-08-28 15:13:16 +02:00
|
|
|
|
2024-08-28 16:02:15 +02:00
|
|
|
ENV CC=/opt/rocm/llvm/bin/clang
|
|
|
|
ENV CXX=/opt/rocm/llvm/bin/clang++
|
2024-08-28 10:38:31 +02:00
|
|
|
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
|
|
|
RUN apt-get update -y
|
|
|
|
RUN apt-get install -y wget git cron cmake make software-properties-common
|
|
|
|
|
|
|
|
# Install python3.10
|
|
|
|
RUN add-apt-repository ppa:deadsnakes/ppa -y && apt-get update -y
|
|
|
|
RUN apt-get install -y python3.10 python3.10-dev python3.10-venv
|
|
|
|
|
|
|
|
ENV VIRTUAL_ENV=/opt/venv
|
|
|
|
RUN python3.10 -m venv $VIRTUAL_ENV
|
|
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
|
|
|
|
|
|
RUN pip3 install --upgrade pip wheel setuptools build
|
|
|
|
|
|
|
|
# Install pytorch for rocm
|
|
|
|
RUN pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_VERSION}
|
2024-08-28 11:18:19 +02:00
|
|
|
# Install deps
|
2024-08-28 10:38:31 +02:00
|
|
|
RUN apt-get install -y hipblas hipblaslt hiprand hipsparse hipcub rocthrust-dev
|
|
|
|
|
2024-08-28 11:18:19 +02:00
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
2024-08-28 10:38:31 +02:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
RUN apt-get clean && pip3 cache purge
|