Giter Site home page Giter Site logo

CUDA out of memory about h2o-llmstudio HOT 6 CLOSED

Garret012034 avatar Garret012034 commented on June 12, 2024 1
CUDA out of memory

from h2o-llmstudio.

Comments (6)

pascal-pfeiffer avatar pascal-pfeiffer commented on June 12, 2024

LLM Studio needs quite a bit of GPU memory to fine-tune the large language models.
We employ state of the art techniques to reduce the amount of VRAM required for training.
Make sure to use LoRA, gradient checkpointing, low batch size (1) and int4 quantization.
May I ask which model you were trying to fine-tune and which GPU you have? With 10 GB VRAM and the above settings, it may be possible to fine-tune a 7B model, but not larger.

from h2o-llmstudio.

Garret012034 avatar Garret012034 commented on June 12, 2024

Thank you for your response. The model trained successfully. It's during execution, opening the 'Chat' tab, that it fails. I see this error in Ubuntu: torch.cuda.OutOfMemoryError. On the 'Config' tab, it shows Lora = True, Gradient Checkpointing = True, Batch Size = 2, and Backbone Dtype = int4.

Maybe I need to change the batch size to 1?

I'm running dual Nvidia GeForce RTX 3080s.

from h2o-llmstudio.

pascal-pfeiffer avatar pascal-pfeiffer commented on June 12, 2024

I am trying to reproduce what could be different in the chat than for fine-tune. Both use the same logic, and locally, I see the memory peaking at around 15 GB for both when loading the checkpoints.
The batch_size is not used during inference/chat. It seems that the model exceeds max VRAM when loading the checkpoint.

from h2o-llmstudio.

psinger avatar psinger commented on June 12, 2024

There is a small memory leak after training, so if the weights are very tight it could oom.
Did you try restarting the whole application and then navigating to the Chat tab?

from h2o-llmstudio.

Garret012034 avatar Garret012034 commented on June 12, 2024

Yes, I did restart the application and restarted the machine just to be sure.

from h2o-llmstudio.

maxjeblick avatar maxjeblick commented on June 12, 2024

Maybe we can init the model with empty weights before loading the checkpoint, haven't tested the workflow yet.
https://huggingface.co/docs/accelerate/v0.11.0/en/big_modeling

from h2o-llmstudio.

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.