Skip to content

Compiler for LightGBM gradient-boosted trees, based on LLVM. Speeds up prediction by ≥10x.

License

Notifications You must be signed in to change notification settings

siboehm/lleaves

Repository files navigation

LLeaVes 🐉

A LLVM-based compiler for LightGBM decision trees.

Ingests model.txt files from trained LightGBM Models and converts them into optimized machine code.

Why LLeaVes?

  • Easy of use: The interface of lleaves.Model is a subset of LightGBM.Booster.
  • Speed: 10x performance increase compared to LightGBM.
  • Few dependencies: llvmlite and numpy. No C/C++ compiler necessary.

Why not LLeaVes?

Some LightGBM features are not yet implemented in LLeaVes:

  • Multiclass prediction
  • Multithreading
  • Linear Models

Benchmarks

benchmark script. LLeaVes has no support for MT so far and is running single-threaded mode only.

Prediction on NYC-taxi (purely numerical features)

img

Prediction on Airlines dataset (purely categorical features)

img

Development

conda env create
conda activate lleaves
pre-commit install
pytest

Current tasks

  • Enable compiler optimization passes
  • Figure out why ONNX won't convert the airlines categorical model
  • Figure out why categorical prediction is so slow with LLeaVes