Repository navigation
Conversation
llama-server was started with every layer on the first GPU even when that GPU was nearly full, and failed with ErrorOutOfDeviceMemory. When the user did not set --agent-gpu-layers, colgrep now skips a GPU whose free memory is below the model's estimated need, and retries once on the CPU if the GPU load still runs out of memory. The device line names the reason.
Author
|
Closing: we keep this fix in our fork for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
colgrep --install-agent(andcolgrep --agent) start llama-server with every layer on the GPU. On a machine whose GPU is almost full (here: an RTX PRO 6000 with 1.4 GB free, used by other services), the load fails with VulkanErrorOutOfDeviceMemoryand the agent does not start.Change
When the user has not set
--agent-gpu-layers:find_gpuestimates the memory the model needs (weights + 20 % + 512 MiB) and skips a GPU that reports less free memory. The model then runs on the CPU, and the device line names the reason, e.g.CPU, 18 threads; NVIDIA RTX PRO 6000 … has 1422 MiB free, the model needs ~3579 MiB.A layer count the user set is kept as before (no fallback).
Testing
cargo test(49 pass),cargo clippyclean,cargo fmtapplied.skips_a_gpu_without_room_for_the_model,model_size_to_gpu_memory,out_of_device_memory_is_recognised.ErrorOutOfDeviceMemory; this build is ready on the CPU in 2.5 s.🤖 Generated with Claude Code