thesps / conifer

Fast inference of Boosted Decision Trees in FPGAs
Apache License 2.0
48 stars 27 forks source link

Long synthesis time on Vitis #17

Open KevinSmild opened 3 years ago

KevinSmild commented 3 years ago

Hi, It seems that synthesis time is really long, specially because the interval requirements for the pipelining are not met and Vitis needs to guess the right parameters (which it does badly). I have been trying to use this tool to compile a GBDT based on XGBoost with 700 trees, 40 features - 1000000 data points - and the following parameters:

{
            'objective': 'binary:logistic',
            'grow_policy': 'lossguide',
            'eval_metric': 'rmse',
            'eta': 1,
            'gamma': 1,
            'alpha': 1,
            'max_leaves': 7,
            'max_depth': 3,
            'seed': 0,
            'nthread': 16
 }

Trying to compile the resulting HLS code without modifying it fails because of the optimizations. After adjusting the optimizations, synthesis time takes hours. The same happened with a similar GBDT with only 50 trees and without modifying the HLS code.

Is there something I might be doing wrong? Is this library recommended for such "big" models?

thesps commented 3 years ago

Hi, in this case I would recommend using the VHDL backend, if possible. The long synthesis time with the HLS is an issue that we don't have a solution for yet. You can see a comparison of the synthesis time as a function of the number of estimators (with depth fixed at 3), from our paper:

Screenshot 2021-06-30 at 16 51 03

(Blue x is HLS C Synthesis, blue + is Logic Synthesis of HLS C Synthesis results, orange circle is Logic Synthesis of VHDL backend code)

KevinSmild commented 3 years ago

Hi, Thanks for the reply. VHDL will make things a little bit more complicated since I am trying to use this as part of Vitis Design Flow, but I'll try.

I still wonder why Vitis compilation takes so long tho. Compilation time is ridiculously long.

Cheers.