training-and-generation
Inspect and operate OpenPrompt training, evaluation, generation, runner selection, device placement, checkpointing, few-shot, zero-shot, LM-BFF, and ProtoVerb workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- training-and-generation
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Inspect and operate OpenPrompt training, evaluation, generation, runner selection, device placement, checkpointing, few-shot, zero-shot, LM-BFF, and ProtoVerb workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md10.3 KB
- 参考文档references/troubleshooting.md7.6 KB
- 参考文档references/workflows.md7.2 KB
- 脚本scripts/inspect_training_config.py18.5 KB
03 SKILL.md 正文
Training and Generation
Use this sub-skill when the task asks how to run, inspect, resume, test, or debug OpenPrompt training/generation jobs after the dataset, template, verbalizer, and package environment choices are known.
Start here:
- Use references/api-reference.md for runner APIs, device placement, config keys, checkpoint/logging semantics, and generation contracts.
- Use references/workflows.md for safe dry-runs, classification, generation, LM-BFF, ProtoVerb, few-shot, zero-shot, resume, and test recipes.
- Use references/troubleshooting.md when CUDA, model cache, dataset, checkpoint, generation length, teacher-forcing, few-shot sampling, LM-BFF, or ProtoVerb behavior fails.
- Use scripts/inspect_training_config.py to summarize a YAML config without loading models, loading datasets, or starting training.
Operating rules:
- Dry-run first. Inspect
experiments/*.yamlwithscripts/inspect_training_config.pybefore runningexperiments/cli.pyor a tutorial script. - Runner selection follows
experiments/cli.py: classification withclassification.auto_torclassification.auto_vusesLMBFFClassificationRunner; classification withverbalizer: proto_verbalizerusesProtoVerbClassificationRunner; other classification usesClassificationRunner;task: generationusesGenerationRunner. - Treat
environment.num_gpus > 0as a real CUDA request. OpenPrompt callsmodel.cuda()or wrapsDataParallel; it does not automatically fall back to CPU when CUDA is unavailable. BaseRunnerwrites TensorBoard and checkpoints underconfig.logging.pathunlesstrain.clean: True. The code writescheckpoints/last.ckptand copies tobest.ckpton improved validation; the declaredcheckpoint.save_latestandcheckpoint.save_bestflags are not enforced byBaseRunner.- Generation training requires batches with
tgt_textand correctteacher_forcing/predict_eos_tokenbehavior. For evaluation/generation, pass generation kwargs deliberately;generation.max_lengthincludes prompt/input tokens in the native generation API. - Few-shot and zero-shot behavior is owned by
experiments/cli.py: few-shot loops oversampling_from_train.seed; zero-shot callsrunner.test()without fitting. - Route dataset layout/config merging details to
../data-and-config-workflows/, prompt grammar/verbalizer design to../template-verbalizer-design/, and top-level import/loading quickstarts to../pipeline-basics/. - Large-model CUDA, UltraChat/
accelerate, and PaddlePaddle tutorial variants are optional workflows. The minimum verified scope is CPU package/config/API inspection, not GPU training throughput or benchmark reproduction.
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).