hummingbird
Hummingbird compiles trained ML models into tensor computation for faster inference.
What is hummingbird?
Hummingbird compiles trained ML models into tensor computation for faster inference.
Overview of hummingbird
What it is
Hummingbird is a library for compiling trained traditional ML models into tensor computations. It allows users to leverage neural network frameworks such as PyTorch to accelerate traditional ML models. Benefits include all current and future optimizations from neural network frameworks, native hardware acceleration, and a unified platform for both traditional and neural network models without re-engineering.
Key features
- Compiles trained traditional ML models into tensor computations for PyTorch, TorchScript, ONNX, and TVM.
- Supports scikit-learn Decision Trees and Random Forest, LightGBM and XGBoost Classifiers/Regressors.
- Provides a uniform inference API following the Sklearn API, allowing easy swapping of models.
- Enables serving models using TorchServe after conversion to PyTorch and TorchScript.
- Works by reconfiguring algorithmic operators for vectorized and GPU execution.
Use cases
- Accelerating inference of traditional ML models on GPU or CPU with neural network framework optimizations.
- Serving traditional ML models using TorchServe.
- Unifying the deployment platform for both traditional and neural network models.
Getting started
Install PyTorch (>=1.6.0) according to your platform and hardware. Then install Hummingbird via pip: python -m pip install hummingbird-ml For optional dependencies (lightgbm, xgboost): python -m pip install hummingbird-ml[extra] Example usage: python import numpy as np from sklearn.ensemble import RandomForestClassifier from hummingbird.ml import convert, load X = np.random.rand(100000, 28) y = np.random.randint(2, size=100000) skl_model = RandomForestClassifier(n_estimators=10, max_depth=10) skl_model.fit(X, y) model = convert(skl_model, 'pytorch') model.predict(X) model.to('cuda') model.predict(X) model.save('hb_model') model = load('hb_model')
License and pricing
Hummingbird is open source under the MIT License.
Based on the project's public README and repository metadata.