Skip to content

Commit 8cdf215

Browse files
committed
smaller base image, conda-pkg cache, move triton to requirements
1 parent 5c6ccf7 commit 8cdf215

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
# xformers available precompiled for:
44
# Python 3.9 or 3.10, CUDA 11.3 or 11.6, and PyTorch 1.12.1
55
# https://github.com/facebookresearch/xformers/#getting-started
6-
FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime as base
6+
#FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime as base
77
#FROM nvcr.io/nvidia/pytorch:22.08-py3 as base
8+
FROM continuumio/miniconda3:4.12.0 as base
89
ENV DEBIAN_FRONTEND=noninteractive
9-
RUN mkdir -p /root/.cache/pip
10-
COPY root-cache/pip /root/.cache/pip
1110
#RUN apt-get install gnupg2
1211
#RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
1312
RUN apt-get update && apt-get install -yqq git
@@ -31,15 +30,18 @@ WORKDIR /api
3130

3231
# We need python 3.9 or 3.10 for xformers
3332
# Yes, we install pytorch twice... will switch base image in future
33+
RUN mkdir -p /opt/conda/pkgs
34+
COPY /conda-pkgs/* /opt/conda/pkgs/
3435
RUN conda update -n base -c defaults conda
3536
RUN conda create -n xformers python=3.10
3637
SHELL ["/opt/conda/bin/conda", "run", "--no-capture-output", "-n", "xformers", "/bin/bash", "-c"]
3738
RUN python --version
3839
RUN conda install -c pytorch -c conda-forge cudatoolkit=11.6 pytorch=1.12.1
3940
RUN conda install xformers -c xformers/label/dev
40-
RUN pip install triton==2.0.0.dev20221105
4141

4242
# Install python packages
43+
RUN mkdir -p /root/.cache/pip
44+
COPY root-cache/pip /root/.cache/pip
4345
RUN pip3 install --upgrade pip
4446
ADD requirements.txt requirements.txt
4547
RUN pip3 install -r requirements.txt

conda-pkgs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
*/
3+
!.gitignore
4+
!README.md

conda-pkgs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See ../root-cache/README.md

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ requests_futures==1.0.0
88
numpy==1.23.4
99
scikit-image==0.19.3
1010
accelerate==0.13.2
11+
triton==2.0.0.dev20221105

0 commit comments

Comments
 (0)