Coder Social home page Coder Social logo

Comments (5)

tgaddair avatar tgaddair commented on May 20, 2024 1

Glad you got it working! We'll be adding some better docs soon to make these parameters easier to find. Closing this issue for now.

from lorax.

flozi00 avatar flozi00 commented on May 20, 2024

Do you measure before or after warmup?

With the start up the kv cache gets reserved, with quantited model there is more memory for cache, but the total used memory is the same.
You could limit the available memory by an argument

from lorax.

tgaddair avatar tgaddair commented on May 20, 2024

Hey @prd-tuong-nguyen, as @flozi00 said this is likely due to the warmup phase, where we allocate additional memory in advance for batching to avoid having to allocate it on the fly during inference.

For example, here's the memory usage reported by nvidia-smi when running with nf4 quantization using mistral-7b before warmup:

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03             Driver Version: 535.129.03   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA A100-PCIE-40GB          On  | 00000000:11:00.0 Off |                    0 |
| N/A   27C    P0              54W / 250W |   5011MiB / 40960MiB |      0%      Default |
|                                         |                      |             Disabled |
+-----------------------------------------+----------------------+----------------------+

And here are the results after warmup:

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03             Driver Version: 535.129.03   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA A100-PCIE-40GB          On  | 00000000:11:00.0 Off |                    0 |
| N/A   27C    P0              54W / 250W |  38911MiB / 40960MiB |      0%      Default |
|                                         |                      |             Disabled |
+-----------------------------------------+----------------------+----------------------+

As you can see, lorax will use as much memory as it can get away to maximize the batch size.

from lorax.

prd-tuong-nguyen avatar prd-tuong-nguyen commented on May 20, 2024

@flozi00 , @tgaddair Oh thanks for your fast reply, I see that the memory before warming up is lower then after that.
Can I reduce the additional memory for batching , in that way I can serve multi-instance in the same GPU.

from lorax.

prd-tuong-nguyen avatar prd-tuong-nguyen commented on May 20, 2024

Resolved by edit cuda_memory_fraction, thank you <3

from lorax.

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.