Skip to content

Add CPU offload strategy for model (auto)unload - #507

Draft
brycehenson wants to merge 40 commits into
remsky:masterfrom
brycehenson:cpu_cache_for_unload
Draft

brycehenson wants to merge 40 commits into
remsky:masterfrom
brycehenson:cpu_cache_for_unload

Conversation

@brycehenson

@brycehenson brycehenson commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

adds a unload strategy which moves the model weights to cpu ram. This substantially speeds up the time to get the model ready for a request.

      - MODEL_UNLOAD_STRATEGY=move_to_cpu

default is "destroy" which reloads from disk

Benchmark

RTX 2070 SUPER with PCIe Gen3 x16 link

Timing

strategy unload avg unload stddev load avg load stddev
destroy 0.027s 0.015s 0.979s 0.189s
move_to_cpu 0.299s 0.022s 0.078s 0.007s

Memory

Memory

strategy VRAM before unload VRAM after unload VRAM delta service RSS delta system RAM delta
destroy 1122.800 MB 630.800 MB -492.000 MB -20.663 MB -22.962 MB
move_to_cpu 915.600 MB 715.600 MB -200.000 MB +236.111 MB +180.091 MB

@RBEmerson970

Copy link
Copy Markdown

adds a cpu cache of the model to reduce load speed

Reduce load speed, or reduce load time? I don't understand why reducing load speed would be a good thing.

@brycehenson brycehenson changed the title Cpu cache for unload Add CPU offload strategy for model (auto)unload Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants