AGENT SKILL

train-and-merge

Routes Chinese-LLaMA-Alpaca-2 dataset prep, training, and LoRA merge workflows.

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

01 前言 Front Matter

name
train-and-merge
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Routes Chinese-LLaMA-Alpaca-2 dataset prep, training, and LoRA merge workflows.
disable-model-invocation
true

02 资源文件 22

03 SKILL.md 正文

train-and-merge

Use this sub-skill for any workflow that prepares training data, runs pretraining or supervised fine-tuning, or merges LoRA adapters back into a full model.

Use it when

  • the user mentions build_dataset.py, run_clm_pt_with_peft.py, run_clm_sft_with_peft.py, run_pt.sh, or run_sft.sh
  • the task is about JSON instruction data with instruction, input, and output fields
  • the user needs DeepSpeed stage-2 configuration or PEFT/LoRA launch flags
  • the task is merging Chinese-LLaMA/Alpaca LoRA weights into HF or PTH outputs

Workflow

  1. Read references/workflows.md for the accepted data schema and training flag map.
  2. Check that the command is being run from scripts/training/ so the bundled vendored peft/ package is importable.
  3. Validate the dataset or model-path assumptions before starting any expensive job.
  4. Use the shell launchers for a quick example of the expected DeepSpeed and LoRA arguments.
  5. Read references/troubleshooting.md if the run fails on imports, dataset layout, or adapter merging.

Bundled runtime files

  • scripts/training/build_dataset.py
  • scripts/training/run_clm_pt_with_peft.py
  • scripts/training/run_clm_sft_with_peft.py
  • scripts/training/run_pt.sh
  • scripts/training/run_sft.sh
  • scripts/training/ds_zero2_no_offload.json
  • scripts/training/peft/
  • scripts/training/build_dataset.py also supplies the collator and dataset cache logic used by SFT
  • scripts/merge_llama2_with_chinese_lora_low_mem.py for LoRA merge/export when a full checkpoint is needed

What to read first

  • references/workflows.md for the training data layout and command family
  • references/troubleshooting.md for local peft, DeepSpeed, bitsandbytes, and dataset errors

Routing notes

  • Use this sub-skill before the inference sub-skill when a task needs a freshly trained or merged checkpoint.
  • The fine-tuning scripts are intentionally adapter-heavy; do not replace them with a generic Hugging Face recipe unless the user explicitly asks for a rewrite.
  • The vendored peft/ package is part of this sub-skill's runtime surface, not a separate external repository.

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