Skip to content

Commit 111825a

Browse files
authored
xformers for auto (#136)
Closes #128
1 parent c1e1386 commit 111825a

File tree

5 files changed

+43
-24
lines changed

5 files changed

+43
-24
lines changed

.github/workflows/executable.yml1

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/xformers.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Xformers
2+
3+
on:
4+
workflow_dispatch: {}
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 180
10+
container:
11+
image: python:3.10-slim
12+
env:
13+
DEBIAN_FRONTEND: noninteractive
14+
XFORMERS_DISABLE_FLASH_ATTN: 1
15+
FORCE_CUDA: 1
16+
TORCH_CUDA_ARCH_LIST: "6.0;6.1;6.2;7.0;7.2;7.5;8.0;8.6"
17+
NVCC_FLAGS: --use_fast_math -DXFORMERS_MEM_EFF_ATTENTION_DISABLE_BACKWARD
18+
MAX_JOBS: 4
19+
steps:
20+
- run: |
21+
apt-get update
22+
apt-get install gpg wget git -y
23+
wget https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.0-1_all.deb
24+
dpkg -i cuda-keyring_1.0-1_all.deb
25+
apt-get update
26+
apt-get install cuda-nvcc-11-8 cuda-libraries-dev-11-8 -y
27+
28+
export PIP_CACHE_DIR=$(pwd)/cache
29+
pip install ninja install torch --extra-index-url https://download.pytorch.org/whl/cu113
30+
31+
pip wheel --wheel-dir=data git+https://github.com/facebookresearch/xformers.git@3633e1afc7bffbe61957f04e7bb1a742ee910ace#egg=xformers
32+
- name: Artifacts
33+
uses: actions/upload-artifact@v3
34+
with:
35+
name: xformers
36+
path: data/xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ services:
3636
profiles: ["auto"]
3737
build: ./services/AUTOMATIC1111
3838
environment:
39-
- CLI_ARGS=--allow-code --medvram
39+
- CLI_ARGS=--allow-code --medvram --xformers
4040

4141
auto-cpu:
4242
<<: *automatic

services/AUTOMATIC1111/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ EOF
2020

2121
RUN git clone https://github.com/crowsonkb/k-diffusion.git repositories/k-diffusion && cd repositories/k-diffusion && git reset --hard f4e99857772fc3a126ba886aadf795a332774878
2222

23+
FROM python:3.10-slim as xformers
24+
SHELL ["/bin/bash", "-ceuxo", "pipefail"]
25+
RUN pip install gdown
26+
RUN gdown https://drive.google.com/uc?id=1SqwicrLx1TrG_sbbEoIF_3TUHd4EYSmw -O /wheel.whl
2327

2428
FROM python:3.10-slim
2529

@@ -66,7 +70,8 @@ RUN pip install --prefer-binary --no-cache-dir opencv-python-headless \
6670
git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \
6771
pyngrok
6872

69-
73+
COPY --from=xformers /wheel.whl xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl
74+
RUN pip install xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl
7075

7176
COPY . /docker
7277
RUN <<EOF

0 commit comments

Comments
 (0)