nemo_rl.models.generation.vllm.speculator_runtime#
Module Contents#
Classes#
Capability used to access the live speculative model. |
|
Ordered transport and loading contract for one model component. |
|
Transport-neutral target and optional draft update description. |
|
Validate exact input coverage while allowing explicit non-owner skips. |
|
Capability-driven access to a live vLLM speculative model. |
Functions#
Return the runner family and live draft model, or None if no capability. |
Data#
API#
- nemo_rl.models.generation.vllm.speculator_runtime.SpeculatorType#
None
- nemo_rl.models.generation.vllm.speculator_runtime.SPECULATOR_TYPES: tuple[str, ...]#
‘get_args(…)’
- nemo_rl.models.generation.vllm.speculator_runtime.is_speculator_type(
- value: object,
- exception nemo_rl.models.generation.vllm.speculator_runtime.SpeculatorRuntimeError#
Bases:
RuntimeErrorThe runtime cannot safely apply a speculative-model refit.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- class nemo_rl.models.generation.vllm.speculator_runtime.RunnerFamily#
Bases:
str,enum.EnumCapability used to access the live speculative model.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- ACCESSOR#
‘get_draft_model’
- DRAFTER#
‘drafter.model’
- SPECULATOR#
‘speculator.model’
- nemo_rl.models.generation.vllm.speculator_runtime.DRAFTER_OWNER_ATTRS: tuple[tuple[str, nemo_rl.models.generation.vllm.speculator_runtime.RunnerFamily], ...]#
((‘drafter’,), (‘speculator’,))
- nemo_rl.models.generation.vllm.speculator_runtime.find_draft_model(
- model_runner: Any,
Return the runner family and live draft model, or None if no capability.
get_draft_modelwins when present. Otherwise the first owner attribute with a non-None.modelwins. When an owner attribute exists but every model is None, the first existing family is returned with a None model.
- class nemo_rl.models.generation.vllm.speculator_runtime.WeightComponentManifest#
Ordered transport and loading contract for one model component.
- ordered_names: tuple[str, ...]#
None
- owner_ranks: tuple[int, ...]#
None
- class nemo_rl.models.generation.vllm.speculator_runtime.ModelUpdateManifest#
Transport-neutral target and optional draft update description.
- draft: nemo_rl.models.generation.vllm.speculator_runtime.WeightComponentManifest | None#
None
- classmethod from_state_dict_info(
- state_dict_info: Mapping[str, tuple[Sequence[int], torch.dtype]],
- *,
- target_owner_ranks: tuple[int, ...],
- draft_owner_ranks: tuple[int, ...],
- class nemo_rl.models.generation.vllm.speculator_runtime.ModelUpdateCoverage(
- manifest: nemo_rl.models.generation.vllm.speculator_runtime.ModelUpdateManifest,
- *,
- rank: int,
Validate exact input coverage while allowing explicit non-owner skips.
Initialization
- _record(names: Sequence[str]) None#
- record_loaded(names: Sequence[str]) None#
- record_owner_skip(
- names: Sequence[str],
- *,
- component: Literal[target, draft],
- require_complete() None#
- class nemo_rl.models.generation.vllm.speculator_runtime.DraftRuntimeAdapter#
Capability-driven access to a live vLLM speculative model.
- model: Any | None#
None
- pp_size: int#
None
- is_owner: bool#
None
- classmethod resolve(
- model_runner: Any,
- *,
- speculator_type: str,
- vllm_version: str,
- pp_rank: int,
- pp_size: int,
- property owner_ranks: tuple[int, ...]#