AGENT SKILL

custom-components

Use RL Baselines3 Zoo custom Gymnasium registrations, wrappers, callbacks, schedules, and algorithm registry patches safely.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
custom-components
license
MIT
metadata
{ "disco-role": "operating" }
description
Use RL Baselines3 Zoo custom Gymnasium registrations, wrappers, callbacks, schedules, and algorithm registry patches safely.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

custom-components

Use this sub-skill when a future Researcher needs to register custom Gymnasium environments, validate wrapper/callback/policy import strings, use RL Zoo's bundled wrappers and callbacks, configure linear schedules, or patch the in-process algorithm registry for SBX or another Stable-Baselines3-compatible algorithm class.

Start here

  1. Decide what kind of component is involved:

  2. Validate import strings before launching training:

    python scripts/component_import_checker.py \
      --wrapper rl_zoo3.wrappers.HistoryWrapper \
      --callback rl_zoo3.callbacks.RawStatisticsCallback \
      --policy stable_baselines3.ppo.MlpPolicy
    
  3. If components are declared in a YAML hyperparameter file, list and validate them without creating an environment:

    python scripts/component_import_checker.py \
      --config ./my_hyperparams.yml --env CartPole-v1
    

Operating checklist

  • Import custom Gymnasium registration modules before RL Zoo checks gym.envs.registry; for installed-package training this is normally python -m rl_zoo3.train --gym-packages my_env_package ... or rl_zoo3 train --gym-packages my_env_package ....
  • Keep custom registration modules import-only: their top-level code should call Gymnasium register(...) and avoid training, network calls, credentials, or heavy initialization.
  • Validate every dotted import string as module.submodule.ClassName. Exact case matters, and the module must be importable in the same Python environment that runs RL Zoo.
  • For wrappers, verify constructor kwargs and environment-space requirements before training. HistoryWrapper, action wrappers, and MaskVelocityWrapper assert on observation/action-space shape or supported env ids.
  • For callbacks, verify constructor kwargs and runtime prerequisites. RawStatisticsCallback needs TensorBoard logging; ParallelTrainCallback is limited to SAC/TQC models.
  • Treat SBX/JAX and external simulator packages as optional dependency surfaces; confirm they are installed before proposing commands that depend on them.

Boundaries and routes

  • Full YAML/Python hyperparameter-file grammar, indentation rules beyond wrapper/callback examples, --conf-file, and --hyperparams: route to ../config-hyperparams/SKILL.md.
  • Actual training/resume/evaluation command execution after components are validated: route to ../training-cli/SKILL.md.
  • Hyperparameter-optimization callbacks and Optuna trial behavior: route to ../tuning-optimization/SKILL.md.
  • Package install, console-entry optional plotting import behavior, and optional simulator dependencies: route to ../../references/install-and-environment.md.

Minimal safe workflow

# 1) Validate component imports and constructor kwargs only.
python scripts/component_import_checker.py \
  --config ./my_hyperparams.yml --env MyEnv-v0 --gym-package my_envs

# 2) If validation passes, hand off the actual run to training-cli.
python -m rl_zoo3.train --algo ppo --env MyEnv-v0 \
  --gym-packages my_envs --conf-file ./my_hyperparams.yml \
  --n-timesteps 1000 --log-folder ./runs/rl-zoo --device cpu

Do not train from this sub-skill unless the caller explicitly asks to execute the validated training workflow; otherwise hand off to ../training-cli/SKILL.md.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351