inference
Routes OpenNMT-py translation, decoding, inference-engine, server, and benchmark/evaluation workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- inference
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Routes OpenNMT-py translation, decoding, inference-engine, server, and benchmark/evaluation workflows.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/translation-and-serving.md8.1 KB
- 参考文档references/troubleshooting.md4.0 KB
- 脚本scripts/validate_server_config.py16.3 KB
03 SKILL.md 正文
Inference
Use this sub-skill when an OpenNMT-py task is about producing translations, scoring outputs, running the REST server, or choosing between PyTorch and CTranslate2 inference paths.
Use this route when
- The request mentions
onmt_translate, decoding options, alignments, score output, beam traces, or batch inference. - The task is about
onmt_server, a servermodel_configfile, REST endpoints, tokenizer setup, preprocess/postprocess hooks, or model cloning/unloading. - The user wants to run OpenNMT-py inference engines, CTranslate2 releases, or LLM-style benchmark/evaluation wrappers that consume released checkpoints.
Do not use this route when
- The main task is building vocabularies or preparing corpora; use
../data-preparation/. - The main task is architecture choice, training schedules, or checkpoint continuation; use
../training/. - The main task is averaging, releasing, or converting checkpoints; use
../conversion/.
Start here
-
Read
references/translation-and-serving.mdfor the command, config, endpoint, engine, and evaluation contracts. -
Run the bundled server-config validator before starting a server:
python scripts/validate_server_config.py --config MODEL_CONFIG.json --root MODEL_ASSET_ROOTAdd
--no-check-fileswhen reviewing a template that intentionally omits model/tokenizer files. -
For a normal decode run, prefer the packaged CLI:
onmt_translate --model MODEL.pt --src src.txt --output pred.txt -
If the job uses a REST server, keep the
model_configfile self-contained and make model/tokenizer paths resolvable from the working directory used to launchonmt_server.
What this sub-skill owns
- Decoding options such as beam search, sampling,
n_best,replace_unk, alignment output, debugging flags, and batch sizing. - Inference-engine selection and runtime behavior for PyTorch and CTranslate2 releases.
- REST server startup, model cloning, unloading, CPU/GPU migration, and model configuration files.
- Translation debugging, tokenizer setup, preprocess/postprocess hooks, and score/alignment troubleshooting.
- Benchmark-style prompt generation or perplexity scoring that evaluates released models rather than training them.
Bundled helper
scripts/validate_server_config.py is a self-contained JSON validator. It checks the top-level server shape, model entries, model roots, tokenizer shape, optional CT2 fields, timeout fields, and path existence without importing the source checkout.
Troubleshooting entry point
If the request fails before any actual translation output is produced, read references/troubleshooting.md first. Most failures are server-config shape issues, missing model paths, tokenizer model paths, incompatible release formats, alignment option conflicts, or attempts to use a GPU-only path without the required backend.
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).