-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow prediction with dask #5729
Comments
Let me take a look. |
The prediction is run for each partition/block so that there's no concatenation for input data (hence lower memory usage). When you set the chunk size to 100, you ended up running prediction 100000 times given you have 10000000 rows. |
I see two issues here. First the chunk size is small. If you change to The reason prediction is 5.5x slower than train is because you need to add |
I think the predictor is automatically running on GPU in this example. |
No it is not. I just ran this on a DGX and posted my results above. By default XGB always uses CPU for prediction. Even if you use |
Got it, took another look into the code. CPU predictor might be chosen because data comes from host. Thanks for correcting my mistake. |
It is good you made your comment trivialfis. Many people including myself last week did not know this. As such I suggest making GPU prediction the default if a user activates the tree method gpu hist parameter. (And yes, maybe the predictor depends on where the data comes from, I'm not sure). |
It's a trade-off. We made some heuristics to avoid copying data into device from host. For training the data is not copied even you are using GPU. Currently DGX is not very accessible to wide public, so we can't make this setting. |
The prediction speed has been improved quite significantly in recent PRs. |
Prediction with Xgboost dask interface is much slower than expected, taking almost 5x training time.
Train Time: 121s
Prediction time: 502s
The text was updated successfully, but these errors were encountered: