xformers for auto (#136)

Closes #128
This commit is contained in:
AbdBarho 2022-10-16 16:35:14 +02:00 committed by GitHub
parent c1e13867d9
commit 111825ac25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 24 deletions

View File

@ -1,22 +0,0 @@
name: Check executable
on: [push]
jobs:
check:
runs-on: ubuntu-latest
name: Check all sh
steps:
- run: git config --global core.fileMode true
- uses: actions/checkout@v3
- shell: bash
run: |
shopt -s globstar;
FAIL=0
for file in **/*.sh; do
if [ -f "${file}" ] && [ -r "${file}" ] && [ ! -x "${file}" ]; then
echo "$file" is not executable;
FAIL=1
fi
done
exit ${FAIL}

36
.github/workflows/xformers.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Build Xformers
on:
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 180
container:
image: python:3.10-slim
env:
DEBIAN_FRONTEND: noninteractive
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
apt-get install gpg wget git -y
wget https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.0-1_all.deb
dpkg -i cuda-keyring_1.0-1_all.deb
apt-get update
apt-get install cuda-nvcc-11-8 cuda-libraries-dev-11-8 -y
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@3633e1afc7bffbe61957f04e7bb1a742ee910ace#egg=xformers
- name: Artifacts
uses: actions/upload-artifact@v3
with:
name: xformers
path: data/xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl

View File

@ -36,7 +36,7 @@ services:
profiles: ["auto"]
build: ./services/AUTOMATIC1111
environment:
- CLI_ARGS=--allow-code --medvram
- CLI_ARGS=--allow-code --medvram --xformers
auto-cpu:
<<: *automatic

View File

@ -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,8 @@ RUN pip install --prefer-binary --no-cache-dir opencv-python-headless \
git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \
pyngrok
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
RUN <<EOF