GithubHelp home page GithubHelp logo

Comments (11)

chris-aeviator avatar chris-aeviator commented on August 10, 2024 1

from everydream2trainer.

chris-aeviator avatar chris-aeviator commented on August 10, 2024 1

Here's what I use for xformers in docker, lmk if it needs something else, removed many lines specific to my setup. I'm unsure if ED2 needs bitsandbytes (8bit adam). You might also not need huggingface transformers if the repo doesnt rely on the diffusers lib.

FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu20.04
LABEL maintainer="Tofu AI"

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
    apt install -y bash \
                   build-essential \
                   git \
                   git-lfs \
                   curl \
                   ca-certificates \
                   python3.8 \
                   python3-pip \
                   python3.8-venv && \
    rm -rf /var/lib/apt/lists

# make sure to use venv (this might not be needed)
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

RUN python3 -m pip install --no-cache-dir --upgrade pip && \
    python3 -m pip install --no-cache-dir \
        torch \
        torchvision \
        torchaudio \
        --extra-index-url https://download.pytorch.org/whl/cu117 && \
    python3 -m pip install --no-cache-dir \
        accelerate \
        datasets \
        hf-doc-builder \
        huggingface-hub \
        modelcards \
        numpy \
        scipy \
        tensorboard \
        git+https://github.com/huggingface/transformers.git@main


RUN pip install ninja bitsandbytes
RUN pip install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers

## install ED2 from here
``

## EDIT:

this did not take into consideration that ED2trainer needs Python 3.10 - I'm currently setting up an ECS instance (linux) with ED2 - will be able to post a install log here 

from everydream2trainer.

chris-aeviator avatar chris-aeviator commented on August 10, 2024 1

things would be even easier with a requirements.txt file

from everydream2trainer.

victorchall avatar victorchall commented on August 10, 2024

Yeah the dependencies are a bit tricky, particularly xformers, I need to get runpod going then I can revisit linux/docker.

from everydream2trainer.

chris-aeviator avatar chris-aeviator commented on August 10, 2024

xformers, bitsandbytes an accellerate should all install fine via any official pytorch image. xformers requires you to build (via a pip command) if you don't use the conda repos, but it usally takes only 2 minutes.

EDIT:
trick to avoid xformers build failing due to a misisng nvcc is to use the developers version of pytorch docker images

from everydream2trainer.

AntouanK avatar AntouanK commented on August 10, 2024

could anyone attempt to make a docker image and if it works, share the Dockerfile here?

from everydream2trainer.

victorchall avatar victorchall commented on August 10, 2024

I use bits and bytes to support 8bit adam (significant performance improvement and ~1.5GB VRAM less) but that should be simple on linux, just install bitsandbytes 0.35.0, or newer versions may work as well on linux.

If bitsandbytes isn't installed, it will fall back to normal AdamW optimizer from torch, so its not strictly necessary. 8bit adamw is significantly faster though, and seems to be worth it.

from everydream2trainer.

UglyStupidHonest avatar UglyStupidHonest commented on August 10, 2024

I have it running fine with just installing the dependencies from I read in the bat file except the Windows stuff. The only tricky bit was that I had to update triton to get the xformers to work . (Ubuntu 20.4 lts)

from everydream2trainer.

victorchall avatar victorchall commented on August 10, 2024

The windows_setup.cmd could be pretty easily stripped to requirements.txt, the patch_bnb is not required, and a different xformers install would be needed. That's most if it. Getting xformers to work in the biggest pain point.

from everydream2trainer.

chris-aeviator avatar chris-aeviator commented on August 10, 2024

what's the issue with xformers you face? It installed just fine with the official instructions every time I installed it, hayppy to assist

from everydream2trainer.

victorchall avatar victorchall commented on August 10, 2024

Qslug has setup a container image here:

https://ghcr.io/qslug/ed2runpod

(should actually be agnostic to provider though, including a local docker instance)

Probably a few more hints here based on runpod/vast setup that could be useful for you:

https://github.com/victorchall/EveryDream2trainer/blob/main/doc/CLOUD_SETUP.md

from everydream2trainer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.