Skip to content

Conversation

@mudler
Copy link
Owner

@mudler mudler commented Dec 15, 2025

Description

This PR is related to #5352

This PR introduces a general Memory reclaimer. We will collect resources from the running system such as GPU ram in use, or just standard RAM usage, and based on that, if exceeds a certain treshold (that can be set explicitly by the user) we start reaping other models (LRU).

This is just a baseline to start, and places basically the foundation to enhance this further in any direction we might want to take it, but should be a good starting point.

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@netlify
Copy link

netlify bot commented Dec 15, 2025

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 5c618a8
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/694114f6380aaf0008bc1a1c
😎 Deploy Preview https://deploy-preview-7583--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

gpus = append(gpus, nvidiaGPUs...)
}

// XXX: Note - I could not test this with AMD and Intel GPUs, so I'm not sure if it works and it was added with the help of AI.
Copy link
Owner Author

@mudler mudler Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for reference ^ I could not really come along with the CLI for specific GPUs because I don't own all of them, however, that was not the goal of this PR. The goal of this PR is to provide all the infrastructure on top of it so we can make use of the GPU data. We can iterate on how we get the GPU data easily later on, as we can move away from this implementation quite easily.

@mudler mudler changed the title feat(watchdog): add GPU reclaimer feat(watchdog): add GPU resource reclaimer Dec 15, 2025
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler changed the title feat(watchdog): add GPU resource reclaimer feat(watchdog): add Memory resource reclaimer Dec 15, 2025
return nil, err
}

total := uint64(memory.TotalUsableBytes)

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> int

integer overflow conversion int64 -> uint64
@mudler mudler marked this pull request as ready for review December 15, 2025 22:04
@mudler mudler force-pushed the feat/gpu-resource-eviction branch from bd32e19 to c39a3a2 Compare December 15, 2025 22:06
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler force-pushed the feat/gpu-resource-eviction branch from c39a3a2 to 5c618a8 Compare December 16, 2025 08:14
@mudler mudler merged commit 50f9c9a into master Dec 16, 2025
26 of 28 checks passed
@mudler mudler deleted the feat/gpu-resource-eviction branch December 16, 2025 08:15
@mudler mudler added the enhancement New feature or request label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants