mstar.engine.resources.resident_hooks#

What a resource overrides to take part in resident planning (resident.py).

Classes

ResidentHooks()

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: object

A 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. key is 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_commit recorded.

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

resident_row(rid, slot, row, writes)[source]#

Set this resource’s cells of rid’s row: it is new or stale. row has the planner’s narrow columns; the owner of a wide table queues its used cells as a run of their own (ResidentWrites.run).

Parameters:
Return type:

None

resident_stage(plan)[source]#

Queue this step’s per-row changes on plan.writes. Host work only: this can run beside a live graph.

Parameters:

plan (ResidentPlan)

Return type:

None