mstar.engine.resources.step#
Classes
|
|
|
|
|
A resource cannot serve this request at all. |
|
|
|
|
|
What the runner answers with: one resource's outcome, plus which resource gave it. |
|
The request's state is moving to host memory; retry once it is back. |
|
|
|
One step's addition to a request's cache stream. |
|
attention admit gives to inform which slot to plan and replay |
|
|
|
- class mstar.engine.resources.step.AdmitFailedReason(message: str)[source]#
Bases:
object- Parameters:
message (str)
- class mstar.engine.resources.step.AdmitOutcome(ok, ready, reason)[source]#
Bases:
NamedTuple- Parameters:
ok (bool)
ready (bool)
reason (AdmitFailedReason | None)
- reason: AdmitFailedReason | None#
Alias for field number 2
- class mstar.engine.resources.step.AdmitRuntimeError(message)[source]#
Bases:
AdmitFailedReasonA resource cannot serve this request at all.
Terminal, unlike the two above: no eviction and no reload makes it go away, so the caller’s answer is to fail the request, not to retry it.
- Parameters:
message (str)
- class mstar.engine.resources.step.AllocationFailed(message: str, pages_short: int, label: str, request_id: str)[source]#
Bases:
AdmitFailedReason
- class mstar.engine.resources.step.BucketKey(graph_walk: str, bs: int, num_tokens: int, cg_key_info: Any | None = None)[source]#
Bases:
object
- class mstar.engine.resources.step.FullAdmitOutcome(outcome, failed_resource=None)[source]#
Bases:
NamedTupleWhat the runner answers with: one resource’s outcome, plus which resource gave it.
A resource doesn’t know the key it is registered under, so the runner — which does — names it on the way out. The caller needs it to scope an eviction to the resource that actually ran out.
- Parameters:
outcome (AdmitOutcome)
failed_resource (str | None)
- outcome: AdmitOutcome#
Alias for field number 0
- property reason: AdmitFailedReason | None#
- class mstar.engine.resources.step.RequestOffloading(message, label, request_id)[source]#
Bases:
AdmitFailedReasonThe request’s state is moving to host memory; retry once it is back.
Distinct from AllocationFailed because the answer is different: nothing needs evicting, the caller just re-drives the step once reload has run.
- class mstar.engine.resources.step.ResourceStep(segments: tuple[mstar.engine.resources.step.Segment, ...] | None = None)[source]#
Bases:
object
- class mstar.engine.resources.step.Segment(request_id, label, span)[source]#
Bases:
NamedTupleOne step’s addition to a request’s cache stream.
A request contributes one segment per label active for it in a step; the batch’s ordered segment list defines the layout of per-token arrays.
spanmay be 0: a zero-span segment reads its stream without extending it (admission reserves nothing, commit is a no-op).A NamedTuple, not a frozen dataclass: one is built per request per step, and the frozen dataclass’s
object.__setattr__-per-field __init__ is the expensive way to do that.
- class mstar.engine.resources.step.SlotLease(slot, bucket)[source]#
Bases:
objectattention admit gives to inform which slot to plan and replay
has no clean channel to plan/commit/release. see O.
- class mstar.engine.resources.step.StepContext(request_ids: collections.abc.Sequence[str], graph_walk: str, slot: int, capture: bool, is_preplan: bool = False, plan_results: dict[str, typing.Any] = <factory>, slot_lease: mstar.engine.resources.step.SlotLease | None = None, piecewise_leases: 'Mapping[str, SlotLease]' = <factory>, _padded_request_ids: collections.abc.Sequence[str] | None = None)[source]#
Bases:
object- Parameters:
- class mstar.engine.resources.step.SubmoduleStep(steps: dict[str, mstar.engine.resources.step.ResourceStep], segments: list[mstar.engine.resources.step.Segment] | None = None, cg_key_info: Any | None = None, _ctx: mstar.engine.resources.step.StepContext = None)[source]#
Bases:
object- Parameters:
steps (dict[str, ResourceStep])
cg_key_info (Any | None)
_ctx (StepContext)
- property ctx#
- get(key)[source]#
- Parameters:
key (str)
- Return type:
ResourceStep | None
- steps: dict[str, ResourceStep]#