llama-gpt icon indicating copy to clipboard operation
llama-gpt copied to clipboard

Cant limit cpu usage

Open bruno-1337 opened this issue 1 year ago • 3 comments

When trying to limit cpu usage following https://www.baeldung.com/ops/docker-memory-limit the model stops working Tried it on the cuda yml file

I am running a R7 5700 at 4.5ghz + GTX 1070

would be nice if there was a easy way to limit cpu usage

bruno-1337 avatar Sep 09 '23 11:09 bruno-1337

Try editing the docker-compose.yml file to add this to your llama-gpt-api service.

deploy:
  resources:
    limits:
      cpus: N # Number of cpu cores to allow.
      memory: NNNM # Your ram limit in MB followed by M, ex: 1024M

After that, execute ./run.sh as usual See here for more https://docs.docker.com/compose/compose-file/compose-file-v3/#resources

M0E-lnx avatar Sep 14 '23 15:09 M0E-lnx

i did everything on the link i provided, which includes the option you gave me, just doesnt work

bruno-1337 avatar Sep 14 '23 16:09 bruno-1337

Try to modify n_threads in the run.sh

# Get the number of available CPU threads
n_threads=$(grep -c ^processor /proc/cpuinfo)

The script tries to use all CPUs in our current machine

naufalso avatar Sep 15 '23 03:09 naufalso