[Paper Review] A Tensor Compiler for Unified Machine Learning Prediction Serving
Hummingbird is a tensor compiler that compiles traditional machine learning models and featurization operators into a unified set of tensor operations, enabling efficient execution on CPUs and GPUs via existing deep learning frameworks. It achieves competitive or superior performance compared to hand-optimized kernels while reducing infrastructure complexity and enabling end-to-end hardware acceleration.
Machine Learning (ML) adoption in the enterprise requires simpler and more efficient software infrastructure---the bespoke solutions typical in large web companies are simply untenable. Model scoring, the process of obtaining predictions from a trained model over new data, is a primary contributor to infrastructure complexity and cost as models are trained once but used many times. In this paper we propose HUMMINGBIRD, a novel approach to model scoring, which compiles featurization operators and traditional ML models (e.g., decision trees) into a small set of tensor operations. This approach inherently reduces infrastructure complexity and directly leverages existing investments in Neural Network compilers and runtimes to generate efficient computations for both CPU and hardware accelerators. Our performance results are intriguing: despite replacing imperative computations (e.g., tree traversals) with tensor computation abstractions, HUMMINGBIRD is competitive and often outperforms hand-crafted kernels on micro-benchmarks on both CPU and GPU, while enabling seamless end-to-end acceleration of ML pipelines. We have released HUMMINGBIRD as open source.
Motivation & Objective
- To address the growing complexity and cost of deploying traditional ML models in enterprise environments.
- To unify disparate featurization and model operators under a single tensor-based abstraction, avoiding the N×M explosion of supporting multiple frameworks and hardware targets.
- To enable efficient, portable, and optimized inference for traditional ML by leveraging existing DNN compilers and runtimes.
- To demonstrate that high-level tensor abstractions can outperform hand-optimized imperative implementations in model scoring.
Proposed method
- Compiles traditional ML models (e.g., decision trees, linear models) and featurizers (e.g., tokenization, normalization) into a minimal set of core tensor operations.
- Uses a two-level optimization pipeline: logical optimizations based on operator composition, followed by physical optimizations via DNN runtime backends.
- Employs novel inference strategies for tree ensembles, including GEMM and TT, selecting the most efficient based on model characteristics.
- Leverages existing DNN frameworks (PyTorch, TVM) and their hardware-optimized backends (CPU, GPU) to execute compiled models.
- Integrates with inference runtimes to enable automatic hardware-aware code generation and optimization.
- Supports both dense and sparse tensor operations, with extensibility for future sparse optimizations (e.g., via TACO).
Experimental results
Research questions
- RQ1Can traditional machine learning models and featurizers be effectively compiled into a unified tensor computation abstraction?
- RQ2Can this tensor-based compilation achieve performance competitive with or better than hand-optimized imperative kernels on CPU and GPU?
- RQ3Does leveraging DNN compilers and runtimes reduce infrastructure complexity and enable seamless hardware acceleration for traditional ML?
- RQ4How does the performance of the compiled tensor model compare across diverse model types, input sizes, and hardware platforms?
Key findings
- Hummingbird achieves a 1200× speedup on the fastest pipeline compared to scikit-learn on CPU, while the slowest pipeline sees only a 60× slowdown due to small or sparse inputs.
- On CPU, 60% of the 2,317 evaluated pipelines show speedup, with 27% experiencing slowdown due to sparsity or low computational load.
- With GPU acceleration, 73% of pipelines see speedup, and the fastest pipeline achieves a 1,000× performance gain over scikit-learn.
- The system outperforms hand-crafted C++ and CUDA kernels in micro-benchmarks despite using high-level tensor abstractions.
- The approach enables end-to-end acceleration of full ML pipelines across diverse hardware, including CPUs and GPUs, with minimal engineering overhead.
- The system is extensible and benefits from future DNN framework improvements without additional effort.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.