AGENT SKILL

hummingbird

Use Hummingbird to convert trained traditional ML models into tensor backends, validate parity, choose backends, and troubleshoot optional dependencies.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
hummingbird
license
MIT
metadata
{ "disco-role": "operating" }
description
Use Hummingbird to convert trained traditional ML models into tensor backends, validate parity, choose backends, and troubleshoot optional dependencies.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

Hummingbird repo skill

Use this skill when a task involves the hummingbird-ml Python package: converting trained classical ML models into PyTorch, TorchScript, ONNX, or TVM-style tensor computations; validating prediction parity; saving/loading converted containers; or diagnosing optional model-source/back-end dependencies.

Quick identification

  • Import package: hummingbird, hummingbird.ml.
  • Distribution: hummingbird-ml.
  • Core APIs: hummingbird.ml.convert(...), hummingbird.ml.convert_batch(...), and hummingbird.ml.load(...).
  • Typical source models: scikit-learn estimators/pipelines, optional LightGBM/XGBoost/Prophet sklearn-style models, optional SparkML models, and ONNX-ML ModelProto inputs.
  • Typical targets: "torch"/"pytorch", "torch.jit"/"torchscript", "onnx", and optional "tvm".

Install and smoke-check

Install the package and extras that match the user's workflow:

python -m pip install hummingbird-ml
python -m pip install 'hummingbird-ml[onnx]'      # ONNX output or ONNX-ML input workflows
python -m pip install 'hummingbird-ml[extra]'     # LightGBM, XGBoost, Prophet source workflows
python -m pip install 'hummingbird-ml[sparkml]'   # SparkML source workflows

Run the bundled environment probe before deeper troubleshooting:

python scripts/check_hummingbird_env.py --json

Read repo provenance when deciding whether this skill matches the current package version or should be refreshed.

Route by task

User task shape Read next
Build a basic convert(...) call, convert a fitted sklearn estimator to PyTorch, or validate predictions quickly core conversion
Use convert_batch, handle uneven fixed-batch inference, or recover from NotFittedError, MissingBackend, or MissingConverter in the core path core conversion
Decide whether a scikit-learn estimator, transformer, Pipeline, ColumnTransformer, or tree strategy is supported sklearn pipelines and operators
Work with ONNX output, ONNX-ML source models, onnxruntime, onnxmltools, skl2onnx, saved containers, digests, or override_flag ONNX and model I/O
Convert LightGBM, XGBoost, SparkML, or Prophet models, or diagnose optional-library install/import failures optional source models
Choose TorchScript, TVM, CUDA/GPU, threading, batching, or benchmark/performance options advanced backends and performance

Core operating rules

  1. Hummingbird converts trained models. If the source estimator must be fitted first, route the user to fit/validate it before calling convert.
  2. Prefer backend="torch" for the lowest-friction CPU parity check unless the user explicitly needs ONNX, TorchScript, TVM, or GPU execution.
  3. Provide representative test_input when tracing/exporting (torch.jit, ONNX, TVM), when shapes are not obvious, or when source packages such as XGBoost need feature-count inference.
  4. Validate parity on the method the downstream code will call: predict, predict_proba, transform, decision_function, or score_samples.
  5. Treat CUDA, TVM, SparkML, LightGBM, XGBoost, and Prophet as optional surfaces. Check imports and backend availability before promising runtime behavior.
  6. Do not use benchmark-scale scripts as smoke tests. Use bundled smoke/probe helpers and tiny data unless the user explicitly requests a benchmark run.

Shared references and helpers

  • API overview summarizes package entry points, backend aliases, constants, containers, and dependency surfaces.
  • Cross-cutting troubleshooting covers install/import, backend, optional dependency, parity, and artifact-loading failures.
  • Environment checker reports package version, available backend aliases, optional imports, and torch CUDA status without installing anything.

Verification note

This skill was generated with CPU PyTorch and ONNX workflows verified. CUDA, TVM, SparkML, LightGBM, XGBoost, and Prophet are documented as optional surfaces unless the active environment separately proves those dependencies/backends.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351