mstar.engine.resources.position.manager#
does plan_rope/apply_rope of cache_manager.py
has ownership of per-(request,label) position counter
Classes
|
Where each of a request's streams has reached. |
|
rotary position on top flashinfer in-place kernels |
- class mstar.engine.resources.position.manager.PositionManager[source]#
Bases:
Resource- classmethod build(spec, info)[source]#
- Parameters:
spec (PositionSpec)
info (EngineResourceInfo)
- class mstar.engine.resources.position.manager.PublishedPositionInfo(counters=<factory>)[source]#
Bases:
PublishedInfoWhere each of a request’s streams has reached. label -> next position.
- update(other)[source]#
- Parameters:
other (PublishedPositionInfo)
- Return type:
None
- class mstar.engine.resources.position.manager.RopeManager(config, device)[source]#
Bases:
PositionManagerrotary position on top flashinfer in-place kernels
- Parameters:
config (PositionConfig)
device (device)
- admit_retrieve(rid, node_name, graph_walk, published)[source]#
Take on the counters a stream was published with.
A node that receives another node’s KV (a CFG branch on its own GPU, a decode engine after disaggregated prefill) has never advanced these streams itself, so its counters start at zero while the KV it just pulled in is many tokens long. Monotonic, like the KV lengths beside them: a stale echo of this node’s own publish never rewinds it.
- Parameters:
rid (str)
node_name (str)
graph_walk (str)
published (PublishedPositionInfo | None)
- Return type:
- apply_qk(q, k, label, rotary_dim=None, interleave=None, rope_scale=None, rope_theta=None, rope_dtype=None, **kwargs)[source]#
- commit(step, ctx)[source]#
record step consumption
- Parameters:
step (PositionStep)
ctx (StepContext)
- plan(step, ctx)[source]#
submits one position id vector for each plan label
plan labels and token ordering comes from KV plan output
- Parameters:
step (PositionStep)
ctx (StepContext)
- Return type:
- publish(request_id)[source]#
- Parameters:
request_id (str)
- Return type:
PublishedPositionInfo | None
- property supports_preplan#