Archived
lora: an unload of an adapter in use drains it instead of answering 409
POST /v1/unload_lora_adapter for an adapter requests still hold marks it draining and answers
202 {"action": "draining", "lora_name", "in_flight": N}: from then on a request naming it gets the
404 an unknown model gets and /v1/models leaves it out, the N requests finish normally, and the
last hold to go frees the slot, which then cools for three step-loop rounds like any freed slot.
An idle adapter still unloads at once with 200; a second unload while it drains answers 202 with
the count as it is then, and 404 once it is gone; a load of the same name while it drains answers
409 (is being unloaded).
The slots' bookkeeping moves out of Engine into lora::SlotTable (core/lora/slots.h): reserve,
publish, acquire with its hold, unload, names. It has its own lock, so a request's hold and an
unload no longer wait behind a load's device copy; Engine::lora_mu_ now only serialises loads,
which is what keeps a reserved slot from being handed out twice. lora_test drives the table
through both paths, and server_test drives the routes over a real table with a streamed request
held open: 200 idle, 202 draining twice, 404 for a new request and on /v1/models/:id, 409 for a
load while draining, the slot freed when the stream ends, 503 while it cools, 200 after.
This commit is contained in:
1 parent
582cda0a53
commit
91127395ee
10 files changed
+495
-93
No files matched your search
@@ -119,13 +119,16 @@ struct ServerOptions {
|
||||
* clock only mean something under load: queried during a long prefill, it tells a link parked
|
||||
* below its maximum from one at rest. */
|
||||
std::function<std::string()> diagnostics_json;
|
||||
/* RUNTIME LoRA (Engine::lora_resolve): a request's `model` naming a loaded adapter gets that
|
||||
* adapter's slot and load uid. Unset with LoRA off, and then any `model` is served by the base. */
|
||||
/* RUNTIME LoRA (Engine::lora_acquire): a request's `model` naming a loaded adapter gets that
|
||||
* adapter's slot, load uid and a hold on it. Unset with LoRA off, and then any `model` is
|
||||
* served by the base. `lora_names` lists the adapters a request may name (not the draining
|
||||
* ones). */
|
||||
std::function<int(const std::string&, int32_t*, uint64_t*, std::shared_ptr<void>*)> lora_acquire;
|
||||
std::function<std::vector<std::string>()> lora_names;
|
||||
/* POST /v1/load_lora_adapter and /v1/unload_lora_adapter (vLLM's names and bodies). */
|
||||
/* POST /v1/load_lora_adapter and /v1/unload_lora_adapter (vLLM's names and bodies). An unload
|
||||
* of an adapter requests still use drains it: RAD_OK with *in_flight > 0 (Engine::lora_unload). */
|
||||
std::function<int(const std::string&, const std::string&, std::string*)> lora_load;
|
||||
std::function<int(const std::string&, std::string*)> lora_unload;
|
||||
std::function<int(const std::string&, std::string*, int*)> lora_unload;
|
||||
|
||||
std::string api_key;
|
||||
bool cors = true;
|
||||
|
||||
Reference in new issue
Block a user