pipelines
Use PaddleX pre-trained pipelines through create_pipeline, the paddlex pipeline CLI, config export, prediction, result saving, devices, engines, and parallel inference.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- pipelines
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use PaddleX pre-trained pipelines through create_pipeline, the paddlex pipeline CLI, config export, prediction, result saving, devices, engines, and parallel inference.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/pipeline-catalog.md6.3 KB
- 参考文档references/pipeline-troubleshooting.md3.8 KB
- 脚本scripts/run_pipeline_smoke.py5.2 KB
03 SKILL.md 正文
PaddleX pipelines
Use this sub-skill when the user wants to run or configure a pre-trained PaddleX pipeline: image/CV pipelines, OCR/document pipelines, time-series pipelines, speech/video pipelines, retrieval/face pipelines, 3D pipelines, or VLM/document-understanding pipelines.
Route away from this sub-skill when the task is:
- single-model custom development, dataset checking, training, evaluation, export, or
create_modelusage — use../modules/. - serving, high-performance inference deployment, Paddle2ONNX, GenAI server/client setup, or plugin installation — use
../deployment/.
Start here
- Identify whether the user already has a built-in pipeline name or a local pipeline YAML.
- For Python API usage, use
from paddlex import create_pipeline. - For CLI usage, use
paddlex --pipeline ...orpaddlex --get_pipeline_config .... - Decide device and engine separately from the pipeline name. CPU is the safest baseline; GPU/HPI and GenAI-backed routes require matching install extras or plugins.
- For multi-artifact document pipelines, save to a directory instead of forcing a single output file.
Read references/pipeline-catalog.md for supported family names, common workflow patterns, and output behavior. Read references/pipeline-troubleshooting.md when pipeline creation, input parsing, result saving, backend selection, or remote service setup fails.
Minimal Python pattern
from paddlex import create_pipeline
pipeline = create_pipeline(
pipeline="image_classification", # or a local YAML path / config dict
device="cpu",
)
for result in pipeline.predict("demo.jpg"):
result.print()
result.save_to_json("output")
result.save_to_img("output")
Verified installed signature for PaddleX 3.7.2:
create_pipeline(pipeline=None, *, config=None, device=None, engine=None,
engine_config=None, pp_option=None, use_hpip=None,
hpi_config=None, **kwargs) -> BasePipeline
Important precedence rule: explicit Python/CLI arguments such as device, engine, use_hpip, engine_config, or pipeline-specific keyword arguments override defaults from a named pipeline or exported YAML config.
Minimal CLI patterns
# Export a built-in pipeline config before editing it.
paddlex --get_pipeline_config image_classification
# Run prediction from the CLI.
paddlex --pipeline image_classification --input demo.jpg --save_path output --device cpu
# Use a local YAML config.
paddlex --pipeline ./pipeline.yaml --input demo.jpg --save_path output
Bundled helper
Use scripts/run_pipeline_smoke.py when you need a small reusable wrapper that checks importability, creates a pipeline, runs predict, and tries common save methods without depending on the original PaddleX checkout.
Examples:
python scripts/run_pipeline_smoke.py --dry-run
python scripts/run_pipeline_smoke.py --pipeline image_classification --input demo.jpg --save-path output --device cpu
python scripts/run_pipeline_smoke.py --pipeline OCR --input demo.png --save-path output/ocr --kwargs-json '{"use_doc_orientation_classify": false}'
The helper may trigger model downloads when you create a real pipeline. Use --dry-run for a no-download install/API check.
High-value checks before answering a user
- Is the pipeline name exact? Names are case-sensitive in several document pipelines (
OCR,PP-StructureV3,PaddleOCR-VL). - Is the input type supported by that pipeline? Document pipelines may accept images, PDFs, URLs, or directories; time-series pipelines usually expect CSV/tabular inputs.
- Does the task require remote LLM/GenAI credentials or a running server (
PP-DocTranslation,PP-ChatOCRv4, PaddleOCR-VL variants)? If yes, route deployment details to../deployment/. - Does the user ask for high-performance inference, serving, or Paddle2ONNX? Use
../deployment/even if the source object is a pipeline.
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).