mstar.engine.resources.resident_hooks#
What a resource overrides to take part in resident planning (resident.py).
Classes
A captured decode step reads per-request state off tables on the device; each owner of that state keeps its own table. |
- class mstar.engine.resources.resident_hooks.ResidentHooks[source]#
Bases:
objectA captured decode step reads per-request state off tables on the device; each owner of that state keeps its own table. A resource overrides these only once it has one.
- bind_resident(planner, key)[source]#
Declare this resource’s tables on the node’s planner, once, at load.
keyis its resource key, under which each step and capture name its stream (ResidentWrites.streams, CapturedResidentStep.streams).- Parameters:
planner (ResidentPlanner)
key (str)
- Return type:
None
- resident_advance(plan)[source]#
Advance the host’s copy of the table by the rule
resident_commitrecorded.- Parameters:
plan (ResidentPlan)
- Return type:
None
- resident_commit(step)[source]#
Record, inside the capture and after the forward, the step’s table updates.
- Parameters:
step (CapturedResidentStep)
- Return type:
None
- resident_gather(step)[source]#
Record, inside the capture, the reads that fill what the step’s forward addresses. Runs at warmup and capture only; a replay repeats the kernels. An attention sets CapturedResidentStep.reads_tables or
host_planned, for whether its kernel reads its pages off the tables or a host plan.- Parameters:
step (CapturedResidentStep)
- Return type:
None
- resident_refusal()[source]#
Why a node holding this resource can’t run on resident tables, or None if it can.
- Return type:
str | None