mstar.engine.resources.sampler.config#
What a model declares about sampling: its spec, its per-request config, its step.
Kept free of the resource and its Triton kernels so a submodule can declare a step without pulling them in behind it.
Functions
|
A seed for one named stream of a request, as a non-negative int64. |
Classes
|
|
|
|
|
- class mstar.engine.resources.sampler.config.SamplerSpec(resource_key: str, nodes: set[str], vocab_size: int | None, enable_repetion_penalty: bool = True, enable_min_p: bool = False, max_repetition_window: int = 0, min_tokens_stop_ids: tuple[int, ...] = (), enable_top_p_first: bool = False)[source]#
Bases:
NodeResourceSpec- Parameters:
- class mstar.engine.resources.sampler.config.SamplerStep(segments: tuple[mstar.engine.resources.step.Segment, ...] | None=None, apply_penalty: bool = True, apply_filters: bool = True, prefill_tracked_tokens: dict[str, torch.Tensor]=<factory>, kept_rids: frozenset[int] | None = None)[source]#
Bases:
ResourceStep- Parameters:
- class mstar.engine.resources.sampler.config.SamplingReqConfig(temperature: float = 0.6, top_k: int = 0, top_p: float = 1, ignore_eos: bool = False, repetition_penalty: float = 1, min_p: float = 0.0, repetition_window: int = 0, min_tokens: int = 0, top_p_first: bool = False, top_p_min_keep: int = 1, penalize_prompt: bool = True, _seed: int = 0)[source]#
Bases:
ResourceReqConfig- Parameters:
- property seed#
- validate(spec=None)[source]#
Raise
ValueErroron a value outside the contract, or onespec’s node cannot honour. None means the sampler’s default.- Parameters:
spec (SamplerSpec | None)
- Return type:
None