GithubHelp home page GithubHelp logo

Tried to allocate 20.00 MiB (GPU 0; 14.76 GiB total capacity; 13.90 GiB already allocated; 14.75 MiB free; 14.14 GiB reserved in total by PyTorch about thechosenone HOT 3 OPEN

zichengduan avatar zichengduan commented on July 20, 2024 2
Tried to allocate 20.00 MiB (GPU 0; 14.76 GiB total capacity; 13.90 GiB already allocated; 14.75 MiB free; 14.14 GiB reserved in total by PyTorch

from thechosenone.

Comments (3)

JahnKhan avatar JahnKhan commented on July 20, 2024

I got the same message. Could you fix this?

from thechosenone.

GraemeHarris avatar GraemeHarris commented on July 20, 2024

@paratechnical @JahnKhan I've had some success using the following https://huggingface.co/docs/diffusers/optimization/memory#memoryefficient-attention, the pipeline is instantiated in the load_trained_pipeline function, where you should be able to try reduce the memory usage as per the hugging face article.

Because I was still low on VRAM I went to the pipe.enable_sequential_cpu_offload() option, which is much slower but working :). I haven't tried model offloading yet, but might be something to try to keep some speed.

from thechosenone.

paratechnical avatar paratechnical commented on July 20, 2024

@GraemeHarris

if model_path is not None:
        # TODO: long warning for lora
        pipe = DiffusionPipeline.from_pretrained(model_path, torch_dtype=torch.float16)
        if load_lora:
            pipe.load_lora_weights(lora_path)
    else:
        pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
    pipe.to("cuda")
    pipe.enable_xformers_memory_efficient_attention()
    pipe.enable_sequential_cpu_offload()

tried it like this and I have the same problem

What kind of GPU configuration are you using?

from thechosenone.

Related Issues (18)

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.