onnx-and-model-io
Use Hummingbird's ONNX backend, ONNX-ML source conversion, and container save/load workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- onnx-and-model-io
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use Hummingbird's ONNX backend, ONNX-ML source conversion, and container save/load workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/model-io.md5.6 KB
- 参考文档references/onnx-workflows.md6.9 KB
- 参考文档references/troubleshooting.md7.4 KB
- 脚本scripts/onnx_conversion_smoke.py11.0 KB
03 SKILL.md 正文
ONNX and Model I/O
Use this sub-skill when a task mentions ONNX output, ONNX-ML input models,
onnxmltools, skl2onnx, onnxruntime, ONNXContainer, saving a Hummingbird
model, loading a saved digest, or deciding whether override_flag=True is safe.
Fast route
- If the user only needs the basic
hummingbird.ml.convert(...)orconvert_batch(...)call shape, route to../core-conversion/SKILL.mdfirst and return here for ONNX-specific dependency, tracing, and artifact choices. - For ONNX output from a fitted sklearn-style model, pass representative
test_inputand usebackend="onnx"; readreferences/onnx-workflows.md. - For ONNX-ML
ModelProtoinputs produced byonnxmltoolsorskl2onnx, check the ONNX-ML recipe and schema limits inreferences/onnx-workflows.md. - For saved Hummingbird artifacts, load with the digest returned by
save()whenever possible; useoverride_flag=Trueonly for trusted artifacts. Readreferences/model-io.md. - When conversion or load fails, diagnose from
references/troubleshooting.mdbefore changing backends or bypassing integrity checks.
Bundled runtime helper
Run scripts/onnx_conversion_smoke.py to
validate a small ONNX backend conversion without relying on source notebooks or
tests:
python scripts/onnx_conversion_smoke.py --json
python scripts/onnx_conversion_smoke.py --onnxml --json
python scripts/onnx_conversion_smoke.py --output hb_onnx_demo --json
The default smoke trains a tiny deterministic sklearn classifier, converts it to
Hummingbird's ONNX backend, and asserts label/probability parity. --onnxml
adds an ONNX-ML source-model check when onnxmltools/skl2onnx are importable.
--output is the only mode that writes an artifact.
What this sub-skill owns
- ONNX target backend requirements and
onnxruntimecontainer behavior. - ONNX-ML input model recipes and
test_inputbehavior. constants.ONNX_TARGET_OPSETandconstants.ONNX_OUTPUT_MODEL_NAMEusage.ONNXContainer,TorchContainer,TVMContainer, and generichummingbird.ml.loadsave/load semantics.- Digest verification, bad-digest failures, and trusted override behavior.
- Prediction interface routing by estimator kind:
predict,predict_proba,transform,decision_function, andscore_samples.
Route elsewhere
- Basic conversion syntax, backend aliases, not-fitted estimators, and
convert_batch:../core-conversion/SKILL.md. - LightGBM, XGBoost, SparkML, Prophet, and optional source package installation:
../optional-source-models/SKILL.md. - CUDA acceleration, TVM, batching/performance tuning, and GPU-specific runtime
choices:
../advanced-backends-and-performance/SKILL.md.
Minimum safety rules
- Do not treat
onnxalone as sufficient for Hummingbird ONNX inference;onnxruntimemust be importable forONNXContainerprediction and loading. - Do not bypass load integrity checks for untrusted artifacts. Prefer
digest=save_return_value; useoverride_flag=Trueonly after an explicit trust decision. - Do not promise CUDA, TVM, LightGBM, XGBoost, Prophet, or SparkML behavior from this sub-skill; those paths are optional and routed to their owning sub-skills.
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).