repo-development
Modify the TRL repository safely as a contributor or maintainer, including trainer consistency, docs, tests, and packaged skills.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- repo-development
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Modify the TRL repository safely as a contributor or maintainer, including trainer consistency, docs, tests, and packaged skills.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/contributor-guidance.md5.9 KB
- 参考文档references/test-selection.md4.6 KB
- 参考文档references/troubleshooting.md4.6 KB
03 SKILL.md 正文
TRL Repo Development
Use this sub-skill when changing the TRL codebase itself: trainer internals, configs, docs, tests, packaged skills, or contribution hygiene. Do not use it for end-user training runs; route usage questions to the training-oriented TRL skills instead.
Route By Change Type
- Trainer or config edits: follow contributor guidance before changing
trl/trainer/ortrl/experimental/; duplicated trainer logic must stay aligned across copies. - Paper-method additions: add the implementation, docs, targeted tests, and a
docs/source/paper_index.mdsubsection for the method or algorithm. - Docs or public API docs: use TRL docstring style and Hugging Face paper links; keep examples small and runnable.
- Test planning: choose the narrowest relevant unit, CLI, distributed, or invariant tests using test selection.
- Packaged skill changes: update bundled skill content and the skill install/list tests together so installed skills remain discoverable.
- Unexpected review failures: diagnose common repository-policy issues with troubleshooting.
Safety Rules
- Preserve self-contained trainers. Do not introduce shared abstractions for generation, reward computation, metric logging, or weight syncing just to remove duplication.
- When editing duplicated logic, update every matching trainer block with the same variable names, branch order, and comments unless trainer semantics require a documented difference.
- Keep main code stable and well-tested; keep experimental edits small and non-invasive unless the task explicitly targets experimental development.
- Prefer direct, lean changes over registries, factories, broad fallbacks, or speculative compatibility branches.
- Run only the tests needed for confidence first, then broaden if the change touches shared behavior or public interfaces.
Quick Checklists
- Duplicated vLLM logic: compare online trainers that share
_generate_single_turn, weight-sync state, and vLLM branches; propagate the same structural edit across GRPO/RLOO and relevant experimental online trainers. - New paper trainer: add trainer/config files, expose imports/CLI docs as appropriate, add targeted tests, document user-facing behavior, and update
docs/source/paper_index.mdwith a Hugging Face paper URL. - Docstring/API change: use backticked types,
*optional*,defaults to ...,orunions, and Transformers reference links in the repository style. - Skill packaging change: keep
SKILL.mdfrontmatter valid, preserve installable directory structure, and cover discovery/install behavior in skill tests.
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).