diff --git a/.github/workflows/xformers.yml b/.github/workflows/xformers.yml index d0113ec..1abc38f 100644 --- a/.github/workflows/xformers.yml +++ b/.github/workflows/xformers.yml @@ -1,12 +1,12 @@ name: Build Xformers -on: [push] - # workflow_dispatch: {} +on: + workflow_dispatch: {} jobs: build: runs-on: ubuntu-latest - timeout-minutes: 90 + timeout-minutes: 180 container: image: python:3.10-slim env: @@ -14,6 +14,8 @@ jobs: XFORMERS_DISABLE_FLASH_ATTN: 1 FORCE_CUDA: 1 TORCH_CUDA_ARCH_LIST: "6.0;6.1;6.2;7.0;7.2;7.5;8.0;8.6" + NVCC_FLAGS: --use_fast_math -DXFORMERS_MEM_EFF_ATTENTION_DISABLE_BACKWARD + MAX_JOBS: 4 steps: - run: | apt-get update @@ -26,7 +28,7 @@ jobs: export PIP_CACHE_DIR=$(pwd)/cache pip install ninja install torch --extra-index-url https://download.pytorch.org/whl/cu113 - pip wheel --wheel-dir=data git+https://github.com/facebookresearch/xformers.git@ba93c5012d00bd1b010514a7bc9bd938c1ad6149#egg=xformers + pip wheel --wheel-dir=data git+https://github.com/facebookresearch/xformers.git@3633e1afc7bffbe61957f04e7bb1a742ee910ace#egg=xformers - name: Artifacts uses: actions/upload-artifact@v3 with: diff --git a/services/AUTOMATIC1111/Dockerfile b/services/AUTOMATIC1111/Dockerfile index 9e855e7..eb8dd32 100644 --- a/services/AUTOMATIC1111/Dockerfile +++ b/services/AUTOMATIC1111/Dockerfile @@ -20,6 +20,10 @@ EOF RUN git clone https://github.com/crowsonkb/k-diffusion.git repositories/k-diffusion && cd repositories/k-diffusion && git reset --hard f4e99857772fc3a126ba886aadf795a332774878 +FROM python:3.10-slim as xformers +SHELL ["/bin/bash", "-ceuxo", "pipefail"] +RUN pip install gdown +RUN gdown https://drive.google.com/uc?id=1SqwicrLx1TrG_sbbEoIF_3TUHd4EYSmw -O /wheel.whl FROM python:3.10-slim @@ -66,7 +70,7 @@ RUN pip install --prefer-binary --no-cache-dir opencv-python-headless \ git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \ pyngrok -COPY xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl . +COPY --from=xformers /wheel.whl xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl RUN pip install xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl COPY . /docker @@ -80,4 +84,4 @@ WORKDIR ${WORKDIR} EXPOSE 7860 # run, -u to not buffer stdout / stderr CMD /docker/mount.sh && \ - python3 -u ../../webui.py --listen --port 7860 --hide-ui-dir-config --ckpt-dir ${ROOT}/models/Stable-diffusion ${CLI_ARGS} + python3 -u ../../webui.py --listen --port 7860 --hide-ui-dir-config --ckpt-dir ${ROOT}/models/Stable-diffusion --xformers ${CLI_ARGS}