Open salmatfq opened 2 years ago
How many features do you use? onnxruntime does not support sparse tensor for tree ensemble right now, only dense. That might explain the memory explosion.
Thanks @xadupre. 2500-3000 features across the different experiments.
I guess that's the reason. Is sparse needed in your case or can you do without?
I guess that's the reason. Is sparse needed in your case or can you do without?
I will look into this and get back to you with an update. Thanks!
Describe the issue In trying to convert an XGBoost model artifact to ONNX and tracking its memory footprint, the size blows up. Profiling the memory usage, loading the resulting ONNX artifact is up to 4x bigger than the artifact's on-disk size. For example for an ONNX artifact of size 8MB, the in-memory usage while loading (onnx.load(model)) is almost 30MB. For reference, the conversion code used is pretty standard:
Urgency ASAP
Env info Python: 3.8.0 onnxmltools version: 1.11.0 xgboost version: 1.3.1
Question Is this behavior expected? Shouldn't the loaded memory be around the same as the model size on disk? How can we reduce the footprint?