unilab.algos.torch.appo.staging

Bounded rollout staging for APPO learners.

Classes

RolloutStagingPool

Preallocated learner-device storage for a bounded set of rollouts.

class unilab.algos.torch.appo.staging.RolloutStagingPool[source]

Bases: object

Preallocated learner-device storage for a bounded set of rollouts.

Raw IPC rollout slots are env-major: [N, T, …]. Learners consume time-major combined batches: [T, K*N, …]. The pool owns the destination tensors and exposes active views without rebuilding them via torch.cat.

Parameters:
__init__(*, capacity, num_envs, slot_shapes, device)[source]
Parameters:
property active_count: int
property slot_versions: tuple[int, ...]
stage_numpy_views(raw_views)[source]

Copy one raw shared-memory rollout into the next staging slot.

Parameters:

raw_views (Mapping[str, ndarray])

Return type:

int

batch()[source]

Return active learner-ready views backed by the staging pool.

Return type:

dict[str, Tensor]