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
89ENV 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
1312RUN 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/
3435RUN conda update -n base -c defaults conda
3536RUN conda create -n xformers python=3.10
3637SHELL ["/opt/conda/bin/conda" , "run" , "--no-capture-output" , "-n" , "xformers" , "/bin/bash" , "-c" ]
3738RUN python --version
3839RUN conda install -c pytorch -c conda-forge cudatoolkit=11.6 pytorch=1.12.1
3940RUN 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
4345RUN pip3 install --upgrade pip
4446ADD requirements.txt requirements.txt
4547RUN pip3 install -r requirements.txt
0 commit comments