mstar.engine.resources.lora.serving#
Which LoRA specs a deployment builds from its serving config’s resources: lora:
block: the model’s declared specs, sized by the block, narrowed to the targets its
adapters touch, and those left with no targets dropped. mstar.model.base.serving_resources
adds them to the model’s other specs.
Functions
|
The model's LoRA specs, the one keyed |
Leave out a node's LoRA spec whose targets the YAML's |
|
|
The deployment's LoRA specs, YAML applied, the one keyed |
|
The targets a deployment keeps when its YAML lists no |
|
Apply the YAML's |
- mstar.engine.resources.lora.serving.declared_lora_specs(model, model_config)[source]#
The model’s LoRA specs, the one keyed
lorafirst, when the YAML has alora:block; none otherwise. The block sizes every spec (one per node that serves adapters): theloraone with the otherresources:overrides, the others before them (size_lora_specs), so a block under another LoRA spec’s own key overrides it there.
- mstar.engine.resources.lora.serving.drop_lora_specs_without_targets(specs)[source]#
Leave out a node’s LoRA spec whose targets the YAML’s
targetslist dropped entirely: its pool would hold slots for adapters it can add nothing to. The modules it owned are then no one’s to load, so the remaining specs refuse an adapter touching them, as a dropped target is refused.- Parameters:
specs (list[NodeResourceSpec])
- Return type:
- mstar.engine.resources.lora.serving.lora_specs(model, model_config)[source]#
The deployment’s LoRA specs, YAML applied, the one keyed
lorafirst; none when its config turns LoRA on nowhere. Built once per model andresources:block in a process (building one reads the model’s module tree), so its callers there share the specs, and with them a runtime load or unload recorded on one.
- mstar.engine.resources.lora.serving.served_lora_targets(lora)[source]#
The targets a deployment keeps when its YAML lists no
targets: those one of its configured adapters touches, as thetargetslist every process then applies. Every other target would hold zero weights in every slot, yet cost its kernels on every step and its memory (the LM head’s and the embedding’s are vocabulary-sized). The first spec (the LLM’s) keeps all of its targets if no adapter touches it; a later spec left with none is not built. None when nothing narrows. The conductor computes it once, before any worker starts, so every process builds the same specs; an adapter that cannot be read fails the deployment here rather than leaving one process with every target.One list for every spec, as the YAML’s: specs whose target names coincide keep a name either one uses.