mstar.engine.resources.runner#
sequencing for resource call cycle
runner only moves .plan outputs by putting under StepContext.plan_results and handing to next. (in fact, maybe plan should do this and runner only moves StepContext?)
Functions
|
Classes
|
drives resources through per-step cycle |
- class mstar.engine.resources.runner.StepRunner(resources, node_resources=None, enable_nvtx=False)[source]#
Bases:
objectdrives resources through per-step cycle
- Parameters:
- admit(step)[source]#
reserve capacity for step
- Parameters:
step (SubmoduleStep)
- Return type:
- admit_retrieve(rid, node_name, graph_walk, published=None)[source]#
bring published state in
gives ready=False when still has inflights; shortcircuit on failure
Swept over node_name’s own resources. Asking a node about resources it does not own is not just wasted work: KVManager.get_labels answers for an unrecognised node with the default [“main”], so the node ends up gated on — and able to allocate against — another node’s cache.
- Parameters:
- Return type:
- build_cuda_graph_buffers(slots, max_bs, max_seq_len, node_name=None)[source]#
resources preallocate the static buffers captured replays will read
Swept over
node_name’s own resources: another node’s slot count and batch size say nothing about a resource this node’s graphs never touch.- Parameters:
slots (list[CGSlotSpec])
max_bs (int)
max_seq_len (int)
node_name (str | None)
- Return type:
None
- commit(step)[source]#
record step consumption
- Parameters:
step (SubmoduleStep)
- Return type:
None
- ingest_request(rid, overrides=None)[source]#
open state on all resources; overrides are per-resource
- Parameters:
rid (str)
overrides (Mapping[str, ResourceReqConfig] | None)
- Return type:
None
- plan(step)[source]#
plan in dependency order
place plan in step.ctx.plan_results before next plan runs again could possibly move that into plan itself
- Parameters:
step (SubmoduleStep)
- Return type:
- pre_admit(step)[source]#
admit over the pre-planning subset, a step ahead
the later full admit covers the rest; these resources see their own state as already reserved and no-op
- Parameters:
step (SubmoduleStep)
- Return type:
- pre_plan(step)[source]#
plan the pre-planning subset, a step ahead
ctx.is_preplan sends each one’s output to its pending slot rather than the live one; the later full plan promotes it. Results are left in ctx.plan_results for the dependents in this same subset.
- Parameters:
step (SubmoduleStep)
- Return type: