siboehm / lleaves

Compiler for LightGBM gradient-boosted trees, based on LLVM. Speeds up prediction by ≥10x.
https://lleaves.readthedocs.io/en/latest/
MIT License
364 stars 29 forks source link

compile with multiple threads #15

Closed chenglin closed 2 years ago

chenglin commented 2 years ago

I find that compile can only use one cpu core. For my model, it may take long time to compile.

Can make compile with multiple threads, just like make -j ?

siboehm commented 2 years ago

This would require splitting the tree into multiple compilation units, which has some downsides and lots of additional complexity. Parallelization is also only one of the ways to improve compilation time. Therefore it's not on my roadmap currently. Most workflows that I've heard of where people use lleaves is to compile their final model once for deployment, hence a ~20min compile time for a very large model is a nuisance but not a show stopper.

siboehm commented 2 years ago

Closing, since this is not currently on my agenda.

mirekphd commented 1 year ago

a ~20min compile time for a very large model is a nuisance but not a show stopper.

... which is considerably longer than it takes to train such a model (even without a GPU) on say, 1 million rows and 100 cols of data:) Not good, but I agree it is not a show-stopper given that you can parallelize compilation over multiple models.