mstar.engine.resources.lora.identity#
Which weights an adapter name stands for, as the prefix cache keys them.
A request on an adapter fills KV pages that differ from the base model’s for the same
tokens, so its prompt’s key chain hangs from a root that names the adapter’s weights
(AdapterPrefixRoots). The preprocess worker, which keys prompts, reads each adapter
once when it is registered; nothing about an adapter travels per step.
Functions
|
SHA-256 over everything an adapter's delta depends on, rank-independent. |
|
The root an adapter's key chains hang from. |
|
The digest of the adapter at |
Classes
|
Adapter name -> the root its requests' key chains hang from. |
- class mstar.engine.resources.lora.identity.AdapterPrefixRoots(roots=None)[source]#
Bases:
objectAdapter name -> the root its requests’ key chains hang from.
A name that is not registered has no root, and a request on it must not be keyed at all: keyed under the base model’s empty root, its pages would serve base requests.
registerandunregisterare the hooks for loading and unloading an adapter at runtime; reads happen on the request-preparation threads (the prepare pool, or the preprocess thread inline), writes on whichever thread registers.
- mstar.engine.resources.lora.identity.adapter_digest(adapter)[source]#
SHA-256 over everything an adapter’s delta depends on, rank-independent.
adapteris aLoraAdapterasread_lora_filereturns it: every module’s name, alpha (the sidecar’s included), and A and B with their dtype and shape, so that equal bytes of a different shape or dtype digest apart.- Return type: