openprompt
Route OpenPrompt prompt-learning, dataset/config, template/verbalizer, and training/generation workflows from a single repo skill.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- openprompt
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route OpenPrompt prompt-learning, dataset/config, template/verbalizer, and training/generation workflows from a single repo skill.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/package-overview.md2.2 KB
- 参考文档references/repo-provenance.md1.3 KB
- 参考文档references/repo-routing-metadata.json523 B
- 参考文档references/troubleshooting.md2.6 KB
- 脚本scripts/check_openprompt_install.py621 B
03 SKILL.md 正文
OpenPrompt
Use this skill when the user asks about OpenPrompt as a package or repository: installing or importing it, loading PLMs, building prompt-learning pipelines, designing templates/verbalizers, validating YAML configs or dataset processors, or inspecting runner and generation behavior.
Start here
references/package-overview.mdfor the verified public surface, dependency expectations, and sub-skill map.references/troubleshooting.mdfor cross-cutting install/import, dependency, config-path, and backend issues.references/repo-provenance.mdwhen checking whether this skill matches the current checkout or before refreshing it.scripts/check_openprompt_install.pyfor the canonical no-download import/API smoke.
Quick install guidance
OpenPrompt 1.0.1 is a Python package built around PyTorch and Hugging Face Transformers. For a source checkout, install the runtime stack first, then install the package itself without pulling in extra build behavior:
python -m pip install torch==1.13.1+cpu transformers==4.19.0 sentencepiece==0.1.96 datasets==2.14.7 scikit-learn==1.3.2 scipy rouge==1.0.0 tensorboardX yacs dill pyyaml
python -m pip install -e . --no-deps
If you only need the published package, pip install openprompt is the simplest entry point. Use the bundled install smoke before deeper debugging.
Route map
sub-skills/pipeline-basics/
Use for the minimal pipeline surface: InputExample, InputFeatures, PromptDataLoader, PromptForClassification, PromptForGeneration, PromptModel, load_plm, and the top-level package exports. This is the first stop for install/import checks and no-download smoke tests.
sub-skills/template-verbalizer-design/
Use for template grammar, manual/mixed/soft/prefix/P-tuning/PTR templates, verbalizers, calibration, LM-BFF prompt generation, and bundled prompt assets. Route prompt-asset validation and label-word/tokenization issues here.
sub-skills/data-and-config-workflows/
Use for DataProcessor families, load_dataset, FewShotSampler, OpenPrompt YAMLs, get_user_config, experiments/cli.py config inspection, and dataset-layout validation. Route path and selector problems here before training.
sub-skills/training-and-generation/
Use for ClassificationRunner, GenerationRunner, LMBFFClassificationRunner, ProtoVerbClassificationRunner, device placement, checkpointing, generation settings, few-shot/zero-shot behavior, and dry-run training config inspection.
Operating notes
- Keep this root skill short and router-like. Use the sub-skills for the concrete API details and runnable helpers.
- Do not run heavy training, dataset downloads, or model downloads from the root skill unless the user explicitly asks for them and the relevant sub-skill says they are expected.
- If a user request mixes prompt construction, config loading, and training behavior, start with
pipeline-basics, then branch totemplate-verbalizer-design,data-and-config-workflows, ortraining-and-generationas needed. - Optional GPU, UltraChat/accelerate, and PaddlePaddle workflows are documented but not part of the minimum verified path for this skill.
- When the current checkout changes, compare it with
references/repo-provenance.mdbefore assuming the skill is still current.
Canonical smoke
Run the bundled smoke from the root skill directory:
python scripts/check_openprompt_install.py
It proves the package import path, key signatures, and a tiny fake-wrapper PromptDataLoader path without needing datasets or model downloads.
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).