AGENT SKILL

data-preparation

Validate and prepare XTuner SFT, MLLM, pretraining, and RL JSONL data, tokenizer/chat-template configuration, caching, packing, and local conversion workflows.

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

01 前言 Front Matter

name
data-preparation
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Validate and prepare XTuner SFT, MLLM, pretraining, and RL JSONL data, tokenizer/chat-template configuration, caching, packing, and local conversion workflows.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

XTuner data-preparation operating skill

Use this sub-skill when the task is about XTuner V1 dataset records, JSONL validation, tokenizer/chat-template selection, dataset caching, packing, or safe local data conversion before training.

Route here

  • Validate OpenAI-style SFT JSONL, including bare message-list lines and object lines with messages or dialogs.
  • Validate multimodal SFT/pretraining JSONL with image/video references, media_root, and class_name="VLMJsonlDataset".
  • Validate RL/GSM8K-style reward JSONL with prompt, data_source, and reward_model.ground_truth.
  • Choose or document DatasetConfig, DataloaderConfig, OpenaiTokenizeFunctionConfig, and FTDPTokenizeFnConfig fields.
  • Explain dataset cache behavior (cache_dir, cache_tag) and packing choices (pack_level, preset pack/sampler files).
  • Convert local GSM8K question/answer files into XTuner RL JSONL without network access.

Route elsewhere

  • Training launch commands, torchrun resources, FSDP/checkpoint/resume, and training logs belong to the training sub-skill.
  • RL trainer, rollout, Ray, judger service, advantage, replay buffer, and inference-backend configuration belong to the reinforcement-learning sub-skill.
  • Model family, tokenizer/model path validity, dense/MoE/VLM backend, attention, FP8, or optional accelerator choices belong to the model-backends sub-skill.
  • Legacy preprocess CLI usage belongs to the cli-and-tools sub-skill unless only schema context is needed here.

Start with the safe local helpers

python ./scripts/validate_xtuner_jsonl.py ./data/openai_sft.jsonl --mode sft
python ./scripts/validate_xtuner_jsonl.py ./data/mllm.jsonl --mode mllm --media-root ./media
python ./scripts/convert_gsm8k_jsonl.py --input-dir ./gsm8k_raw --out-dir ./gsm8k_xtuner
python ./scripts/validate_xtuner_jsonl.py ./gsm8k_xtuner/train.jsonl --mode rl

The bundled scripts use only the Python standard library. They do not import XTuner, a tokenizer, PyTorch, image libraries, or any original repository checkout.

References to load

Operating rules

  1. Validate JSONL before proposing a training launch.
  2. For multimodal data, always resolve local image/video references with an explicit media_root and fail fast on missing files.
  3. Treat the validator's --max-length output as an approximation only; real truncation depends on the selected tokenizer and chat template.
  4. When pack_level="preset", ensure both pack_config_path and sampler_config_path are set before handing off to training.
  5. For RL data, reward_model.ground_truth is required for GSM8K-style rule reward; do not hand off RL data with missing or empty ground truth.

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