collectors-and-replay
Collect rollouts, select collector topologies, configure replay buffers, and debug TorchRL data movement.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- collectors-and-replay
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Collect rollouts, select collector topologies, configure replay buffers, and debug TorchRL data movement.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/api-reference.md9.1 KB
- 参考文档references/collector-workflows.md9.4 KB
- 参考文档references/replay-buffer-workflows.md11.3 KB
- 参考文档references/troubleshooting.md9.0 KB
- 脚本scripts/smoke_collector.py3.4 KB
- 脚本scripts/smoke_replay_buffer.py5.0 KB
03 SKILL.md 正文
TorchRL collectors and replay
Use this sub-skill when a task involves TorchRL rollout collection, evaluation rollouts, replay-buffer composition, sequence or slice sampling, prioritized replay, generation-safe record updates, memmap storage, checkpointing, HER, or optional service-backed replay.
Route here for
Collector,AsyncCollector,MultiCollector,Evaluator,frames_per_batch,total_frames,trajs_per_batch,sync,backend,backend_options,num_collectors,update_policy_weights_, and weight-update schemes.- Direct, local process, Ray, RPC, distributed, and Submitit collector topology selection.
ReplayBuffer,TensorDictReplayBuffer,TensorDictPrioritizedReplayBuffer,LazyTensorStorage,LazyMemmapStorage,SliceSampler,Sequence,PrioritizedSampler,TensorDictRoundRobinWriter,update_tensordict_priority, andupdate_if_present.- Collector-to-replay integration, explicit
device/storing_device/policy_device/env_devicedecisions, and debugging TensorDict movement across collection and storage.
Route out instead
- Environment construction, specs, transforms, Gym/Gymnasium wrappers, and
step_mdplayout questions: useenvs-and-transforms. - Actor, critic, recurrent policy, distribution, and TensorDictModule construction: use
modules-and-policies. - Loss modules, trainers, target updates, and algorithm optimization loops: use
objectives-and-training. - Generic TorchRL service registry, LLM collectors, VLA schemas, rendering, or serving backends: use
llm-vla-and-services.
Operating references
- Read collector-workflows.md for collector topology, sync/async choices, explicit devices, Evaluator, and collector-to-replay patterns.
- Read replay-buffer-workflows.md for buffer composition, storages, samplers, writers, transforms, sequence units, priorities, HER, memmap, checkpointing, and service-backed replay.
- Read api-reference.md for verified signatures and import paths.
- Read troubleshooting.md when collection, storage, sampling, priority updates, process workers, memmap cleanup, or optional Ray services fail.
Bundled smoke helpers
- scripts/smoke_collector.py: CPU-only direct collector, explicit devices, direct collector-to-replay integration, and synchronous Evaluator smoke.
- scripts/smoke_replay_buffer.py: CPU-only TensorDict replay, LazyTensor/LazyMemmap storage, prioritized replay,
Sequencesample unit masks, checkpoint round trip, and generation-safe updates.
Run these helpers from any working directory after TorchRL and TensorDict are importable. They do not download assets, launch distributed services, or train models.
Evidence basis
This runtime guidance was distilled from relative TorchRL evidence covering torchrl/collectors/, torchrl/data/replay_buffers/, collector and replay reference pages, collector/evaluator/replay tutorials, selected collector and replay examples, selected test/collectors/ and test/rb/ behavior, and installed API probes. Optional Ray, RPC, Submitit, CUDA, simulator, and service-backed behaviors are documented as optional or reference-only unless a future task verifies those backends explicitly.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).