AGENT SKILL

scaling-and-backends

Choose and diagnose TRL scaling, memory, kernel, PEFT, and vLLM backends without launching expensive training or serving jobs.

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

01 前言 Front Matter

name
scaling-and-backends
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Choose and diagnose TRL scaling, memory, kernel, PEFT, and vLLM backends without launching expensive training or serving jobs.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Scaling and Backends

Use this sub-skill when a TRL task is about making training fit, run faster, or use the right distributed/inference backend. This includes Accelerate launch topology, FSDP, DeepSpeed, PEFT/LoRA/quantization, Liger, Unsloth, Kernels Hub attention implementations, activation offloading, and vLLM server or colocated generation.

Route elsewhere when the user is choosing the training algorithm or reward objective, writing CLI/dataclass syntax in detail, or integrating environment-specific experiment systems. Keep this sub-skill focused on backend decisions, resource constraints, and safe diagnostics.

Quick Routing

  • For launch topology, FSDP, DeepSpeed, sequence/context parallelism, mixed precision, PEFT, quantization, kernels, Unsloth, RapidFire, or memory reduction, start with backend-selection.
  • For online generation acceleration with use_vllm=True, server vs colocate mode, server flags, weight sync, ports, and continuous batching implications, use vllm-reference.
  • For failed imports, missing extras, CUDA unavailability, vLLM URL timeouts, OOM, parallel-size mismatches, PEFT/quantization package errors, and service constraints, use troubleshooting.
  • Before recommending optional extras or hardware-heavy commands, run the safe diagnostic wrapper: python scripts/check_optional_backends.py. It only checks imports, versions, and visible accelerator facts; it does not start servers, train, download models, or allocate large tensors.

Safe Backend Workflow

  1. Identify the bottleneck: model does not fit, generation is slow, launch needs more GPUs, kernels are missing, or service connectivity is broken.
  2. Check installed optional backends and visible accelerator state with scripts/check_optional_backends.py before suggesting vLLM, DeepSpeed, PEFT, bitsandbytes, Liger, Unsloth, or kernels-specific paths.
  3. Pick the least invasive backend that addresses the bottleneck: batch/sequence reduction first, PEFT/quantization next, kernels/Liger for speed-memory wins, FSDP/DeepSpeed for sharding, and vLLM only for online trainers with generation bottlenecks.
  4. Keep trainer semantics with the relevant algorithm sub-skill. This sub-skill can say whether GRPOConfig(use_vllm=True, vllm_mode="server") is appropriate, but not redesign the GRPO reward objective.
  5. Do not run accelerate launch, trl vllm-serve, training scripts, model downloads, or Docker/service commands unless the user explicitly approves the resource use and hardware assumptions.

High-Value Defaults

  • Use accelerate launch for multi-GPU TRL training; use the distilled config families in backend-selection rather than copying source repo paths.
  • Use FSDP2/context parallelism for long-context memory pressure when the environment has modern Accelerate/PyTorch support.
  • Use DeepSpeed ZeRO when optimizer/gradient/parameter sharding or offload is the main need and DeepSpeed is already available or can be installed.
  • Use PEFT/LoRA or QLoRA when the user can trade full fine-tuning for adapter training and lower memory.
  • Use vLLM server mode when online RL generation is the bottleneck and separate generation GPUs or a separate service are available; use colocate only when GPUs are limited and resource contention is acceptable.

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