-
Notifications
You must be signed in to change notification settings - Fork 546
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
[FEA] Simplify process to train cuml KMeans on GPU and save the model and later load on a CPU machine for inference #3626
Comments
This code seems to be working:
Also see sklearn's Model persistence page |
@viclafargue Thank you, this seems to be really interesting trick, Is there any disadvantage of doing this? Also, why do we need to set |
I don't see any disadvantage apart from the fact that this method may not work with every estimators. Know that if you're only interested in storing your trained cuML estimator it is possible to persist it with pickling. It will then be redeployed to GPU allowing faster predictions/transformations.
This is something specific to Scikit-Learn's KMean code. It needs to be specified to avoid a crash during prediction. In my understanding, it is used to set the number of threads to be used in OpenMP. |
@viclafargue Thanks for clarifying it. This saved hours of re-training using scikit-learn kmeans implementation. I think there should be a way to do this directly in cuml, since not everyone uses GPU's in their production environment for inference. Is there a way I could turn this post into a feature request? |
@John-8704 turning it into a feature request would be very welcomedd |
@dantegd I have edited the post, I hope that would suffice. I guess someone should change the labels attached to this post. |
This issue has been labeled |
We will consider this a feature request for simplification of this process in a future release (and documenting better). Thank you for filing! |
This issue has been labeled |
I am trying to use KMeans in CUML for fitting the data, but for inference/prediction I want to do it on CPU? Is it possible somehow? I really need a way to predict on CPU. Please help
EDIT:
I feel like it's useful feature for the community, since training and tuning is more resource taking process using GPU make sense but for inference I feel like a CPU machine should do a decent job in production.
The text was updated successfully, but these errors were encountered: