You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d183404
Browse filesBrowse the repository at this point in the historyBrowse files
fix(server): load only the LoRA adapters a model declares (#752)
* fix(server): load only the LoRA adapters a model declares
A request's options.lora and options.lora_id now have to name a LoRA that
the model's profiles declare (a lora_paths source or served name, a
runtime.lora_id or a runtime.lora). Any other value is a 400 on the
direct and queued encode, extract and score paths, and the gateway
refuses it before dispatch, as it already does for generation's
lora_adapter. The registry refuses an undeclared id for every caller.
The PEFT mixin also refuses adapter configs whose loading changes the
shared base model: an init_lora_weights other than true, false,
gaussian, eva or orthogonal, layer_replication, megatron_config, and
non-LoRA PEFT types.
A batch whose LoRA cannot be made active now fails its requests instead
of leaving them pending. LoRA loads and unloads run while no batch of
the model is in flight, and a LoRA evicted while it loaded is unloaded
once its load finishes.
* fix(server): accept only declared LoRA ids in options.lora_id
options.lora_id names a LoRA to load, so the request merge and the
gateway now accept only a declared id there, as the registry does. A
served name stays valid in options.lora, which selects a loaded LoRA.
A LoRA that is already loaded is ready without waiting for the model's
LoRA lock, which an eviction can hold while a batch finishes.
* fix(server): load a LoRA while the model's worker is stopped
A stopped worker has shut its inference executor down, so a LoRA load or
unload that waits for its dispatch lock now runs on the default executor
instead of failing.
* fix(server): fetch LoRAs outside inference and keep loaded adapters out of errors
A request-time LoRA load now downloads its files outside inference: a Hub
LoRA is fetched once, at one commit, with only adapter_config.json and
adapter_model.safetensors, and only the in-memory attach from that local
snapshot waits for the model's in-flight batch. A failed load is held
back with a doubling backoff from 5 s to 5 min, answered with a retryable
503 LORA_LOADING and Retry-After instead of being fetched again on every
request.
The adapter config and the weights file are both validated on that
snapshot: weights other than a LoRA's own parameters, and weights
shipped only as .bin, are refused, because PEFT loads any other tensor
name into the model it wraps.
A batch whose LoRA cannot be made active fails the same way on the
pre-formed path the queue and the sidecar use as on the direct path.
When the registry can load that LoRA, it starts the load and the
requests get the retryable 503; otherwise they get a 400. Selecting a
LoRA while none is loaded is refused instead of serving the base model.
No adapter's error text lists the loaded or served adapters.
A request's LoRA options are now checked against the profile it selects,
not every profile of the model, on the server and the gateway.
---------
Co-authored-by: Krisztian Gajdar <krisztian@superlinked.com>
Copy file name to clipboardExpand all lines: packages/sie_server/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1060,7 +1060,7 @@ auto-retries; see `packages/sie_sdk/README.md` for client-side controls.
1060
1060
| `SIE_MAX_BATCH_REQUESTS` | `64` | Maximum number of items per batched inference call. |
1061
1061
| `SIE_MAX_BATCH_WAIT_MS` | `15.0` | Initial value for the adaptive first-request batch timeout. At runtime the PI batching controller steers it between `SIE_ADAPTIVE_BATCHING__MIN_WAIT_MS` and `SIE_ADAPTIVE_BATCHING__MAX_WAIT_MS`, so it is a starting point rather than a fixed wait. |
| `SIE_MAX_LORAS_PER_MODEL` | `10` | Maximum concurrent LoRA adapters per base model. |
1063
+
| `SIE_MAX_LORAS_PER_MODEL` | `10` | Maximum concurrent LoRA adapters per base model. A request loads or selects only the adapters its selected profile declares. `options.lora` or `options.lora_id` naming any other is rejected with HTTP 400: `INVALID_INPUT`from this server, and `INVALID_REQUEST` from the gateway (code `unknown_lora_adapter` where it answers in the OpenAI error envelope). |
1064
1064
| `SIE_MAX_ITEM_TEXT_BYTES` | `2097152` (2 MiB) | Most bytes of UTF-8 one encode, score, or extract item may carry in its `text` and `metadata` together. A larger item is rejected with `INVALID_INPUT` (HTTP 400) before it is tokenized. Generation prompts are not items and are not affected. |
0 commit comments