mstar.model.waypoint.submodules#
Classes
|
The world DiT: one latent frame per engine step, TAEHV-decoded in the same forward. |
|
TAEHV encoder: |
- class mstar.model.waypoint.submodules.WaypointDitSubmodule(dit, taehv, config)[source]#
Bases:
_FunctionalAeMixin,NodeSubmoduleThe world DiT: one latent frame per engine step, TAEHV-decoded in the same forward.
The decode is fused in rather than left on its own node so a same-worker speculative N+1 (
GraphNode.enable_async_scheduling) can start while N’s frame is still going out. SeeWaypointModel’s module docstring for the resulting two-node graph.- Parameters:
dit (WaypointDiT)
taehv (Module)
config (WaypointConfig)
- bind_node_resources(resources)[source]#
Require both resources before letting the bind reach the layers.
- Parameters:
resources (dict)
- Return type:
None
- can_batch(batch, model_inputs)[source]#
Rows are independent (
preprocessconcatenates on the batch dim and every resource is scoped per row), so any admitted set is batchable.- Return type:
- check_stop(request_id, request_info, outputs)[source]#
Stop the rollout loop after exactly
num_stepsiterations.Iteration k (0-based) is still being postprocessed when the loop counter reads k, so N frames means firing at
k + 1 >= N. Under async scheduling an overshoot iteration this signal is too late to stop is vetoed instead inprepare_inputs.
- cleanup_request(request_id)[source]#
Drop the request’s clock. The ring itself is released by the engine’s
remove_requestsweep (RingKVManager.remove_request), not here.- Parameters:
request_id (str)
- declare_step(graph_walk, request_ids, inputs, slot_lease=None, piecewise_leases=None, **kwargs)[source]#
Name both resources so the runner drives their lifecycle.
Neither step carries segments or reserves anything: a ring overwrites in place, so there is no span to admit. Declaring them is still required for
admitto hand a request one of the node’s worlds. The KV step carries the ring clock viaRingKVStep, lettingRingKVManager.admitcheck it against the frame its lastcommitrecorded for that rid.- Parameters:
graph_walk (str)
inputs (list[NodeInputs])
- Return type:
- forward(graph_walk, engine_inputs, frame_pos, mouse, button, scroll, noise=None, latent=None, **kwargs)[source]#
One frame.
rolloutdenoises it from noise,primeappends a real one; both commit to the ring, decode it with TAEHV in the same call, and return the decoded frame, the updated histories, and the clock passthrough.engine_inputsis unused here, on purpose: under capture it is the dummy request’s forever. The ring and attention backend come offself.node_resources, resolved once atbind_node_resources.
- forward_batched(graph_walk, engine_inputs, **kwargs)[source]#
Run the batched
forwardonce, then split its rows back out.Row
iof every output tensor belongs toengine_inputs.request_ids[i], the same row-order invariantpreprocessused going in.
- get_accelerator_graph_configs(device, tp_world_size=1)[source]#
Both walks, as optional captures.
Prime’s inputs are the rollout template with
noiserenamed, so it reuses the pool the rollout graph already sized.- Parameters:
- Return type:
- max_batch_size(graph_walk)[source]#
Both walks carry up to
step_batch_sizerows: one per resident world sharing the forward.
- postprocess(request_id, request_info, outputs, inputs=None, **kwargs)[source]#
Advance the ring clock by exactly one committed frame, and copy the fused decode’s updated histories into the request’s stable tensors.
Both walks commit, so both advance the clock. The clock advance is metadata only, and the history copy is a device
copy_into the same fixed-address tensorsprepare_inputsreads back next call – neither syncs.- Parameters:
request_id (str)
request_info (CurrentForwardPassInfo)
inputs (NodeInputs | None)
- prepare_inputs(graph_walk, fwd_info, inputs, **kwargs)[source]#
This frame’s row: the ring clock, its controller slice, and either the noise to denoise from (rollout) or the latent to prime with. Also the nine decoder histories the fused decode reads and writes.
Runs on the host, outside any captured region, which is why the noise is drawn here rather than in
forward: a captured region cannot call the RNG.inputs.get("clock")is never read; it only has to be present ininput_namesforGraphNode.is_ready_for_speculationto propose the next iteration as a same-node speculation target.- Parameters:
- Return type:
NodeInputs | None
- preprocess(graph_walk, engine_inputs, inputs)[source]#
Concatenate every row’s tensors along the batch dim, in
engine_inputs.request_idsorder (inputs[i]pairs positionally with rowi– the row-order invariant every batched resource below this node relies on).len(inputs) == 1returns the row unchanged, no copy.- Parameters:
graph_walk (str)
engine_inputs (ModelInputsFromEngine)
inputs (list[NodeInputs])
- Return type:
- class mstar.model.waypoint.submodules.WaypointVaeEncoderSubmodule(taehv, config)[source]#
Bases:
_SingleRequestMixin,_FunctionalAeMixin,NodeSubmoduleTAEHV encoder:
temporal_compressionraw frames -> one latent frame.image_inputs[4, 720, 1280, 3]uint8 ->latent[1, 1, 32, 32, 64], the dit’s priming input unchanged. Prime walk only.- Parameters:
taehv (Module)
config (WaypointConfig)
- cg_key_info(graph_walk, per_request_info, per_request_input_metadata=None, **kwargs)[source]#
The captured (H, W) bucket for this batch’s seed, or None for eager.
The seed shape isn’t on
model_inputsat lease time, so it is read offstep_metadata["seed_hw"], set byget_initial_forward_pass_args.
- forward(graph_walk, engine_inputs, image, **kwargs)[source]#
Encode the seed clip into the latent the dit primes the world on. Request ids are never read here: forward deletes
engine_inputsoutright, so it never needs a real request’s ids, captured or not.