AGENT SKILL

training-data

Guides RWKV-LM data preparation, RWKV-5/6/7 training command construction, checkpoint resume behavior, and training-backend troubleshooting.

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

01 前言 Front Matter

name
training-data
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Guides RWKV-LM data preparation, RWKV-5/6/7 training command construction, checkpoint resume behavior, and training-backend troubleshooting.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

RWKV training and data

Use this route when the request mentions RWKV-5, RWKV-6, RWKV-7, MiniPile, Pile/binidx data, make_data, magic_prime, my_exit_tokens, train_stage, my_testing, DeepSpeed, Lightning, checkpoint resume, or training spikes.

Route by task

  • Prepare a corpus: read data-formats.md, run the bundled JSONL converter, then run the bundled magic-prime checker.
  • Train RWKV-7: read training-workflows.md before constructing a command. RWKV-7 train_temp is the current reference implementation; do not mix its flags with the older v5/v6 launcher.
  • Train RWKV-5/6: read v5-v6-compatibility.md. RWKV-6 is selected through the RWKV-5 training tree with --my_testing x060.
  • Resume or debug a run: read troubleshooting.md and inspect checkpoint names and train_log.txt before changing flags.

Safe preparation sequence

  1. Confirm the tokenizer family, vocabulary size, data prefix, total token count, context length, model family, and target backend.
  2. Convert JSONL only into a new output prefix. Keep the source JSONL unchanged and never use a training launcher that deletes checkpoints as a first step.
  3. Verify that the output has matching .bin and .idx files and that each document ends with token 0 when using the RWKV v20230424 tokenizer.
  4. Compute a magic_prime for the exact token count and ctx_len; do not copy a value from a different context length. The candidate must be prime and congruent to 2 mod 3.
  5. Construct an initialization command (train_stage/my_pile_stage 1) and a separate resume command (stage 2/3). Use a fresh proj_dir for the first run and save the complete command in the run directory.
  6. Perform a parser/help check and a tiny data-layout check before allocating GPU time. Full training is long-running and requires the checkout's matching CUDA extension sources, toolkit, and data files.

Non-negotiable training rules

  • Keep ctx_len, magic_prime, and my_exit_tokens consistent with one data prefix. The trainer uses mini-epochs of 40320 * ctx_len tokens.
  • Match head_size/head_size_a to the model family. RWKV-7 reference code expects a head size of 64 for the standard x070 LM configuration.
  • RWKV-7 has carefully chosen initialization, parameter-specific learning-rate scales, and weight-decay groups. Do not simplify the optimizer grouping and assume the same loss curve.
  • Set grad_cp=1 to reduce memory at the cost of speed. Tune micro_bsz and head_chunk before changing architecture flags.
  • A checkpoint directory is stateful: stage-2/3 code searches for the latest rwkv-*.pth. Remove or move stale files only after recording a backup and confirming the intended resume point.
  • CUDA torch availability is not proof that the repository's custom .cu extensions can compile. Check CUDA_HOME, nvcc, compiler ABI, and the selected torch CUDA tag separately.

Bundled helpers

These helpers are adapted from the repository's data utilities and do not require the original checkout's hard-coded paths.

Handoff

After data and command construction, route model generation or prompt sampling to inference-evaluation. Route tensor names, checkpoint conversion, or context-parallel state questions to architecture-reference. Route ROSA experiments to rosa-experiments.

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