Will scikit-learn utilize GPU?

前端 未结 2 870
野的像风
野的像风 2020-12-04 20:44

Reading implementation of scikit-learn in tensroflow : http://learningtensorflow.com/lesson6/ and scikit-learn : http://scikit-learn.org/stable/modules/generated/sklearn.clu

相关标签:
2条回答
  • 2020-12-04 21:40

    Tensorflow only uses GPU if it is built against Cuda and CuDNN. By default none of both are going to use GPU, especially if it is running inside Docker, unless you use nvidia-docker and an image capable of doing it.

    Scikit-learn is not intended to be used as a deep-learning framework, and seems that it doesn't support GPU computations.

    Why is there no support for deep or reinforcement learning / Will there be support for deep or reinforcement learning in scikit-learn?

    Deep learning and reinforcement learning both require a rich vocabulary to define an architecture, with deep learning additionally requiring GPUs for efficient computing. However, neither of these fit within the design constraints of scikit-learn; as a result, deep learning and reinforcement learning are currently out of scope for what scikit-learn seeks to achieve.

    Extracted from http://scikit-learn.org/stable/faq.html#why-is-there-no-support-for-deep-or-reinforcement-learning-will-there-be-support-for-deep-or-reinforcement-learning-in-scikit-learn

    Will you add GPU support in scikit-learn?

    No, or at least not in the near future. The main reason is that GPU support will introduce many software dependencies and introduce platform specific issues. scikit-learn is designed to be easy to install on a wide variety of platforms. Outside of neural networks, GPUs don’t play a large role in machine learning today, and much larger gains in speed can often be achieved by a careful choice of algorithms.

    Extracted from http://scikit-learn.org/stable/faq.html#will-you-add-gpu-support

    0 讨论(0)
  • 2020-12-04 21:43

    I'm experimenting with a drop-in solution (h2o4gpu) to take advantage of GPU acceleration in particular for Kmeans:

    try this:

    from h2o4gpu.solvers import KMeans
    #from sklearn.cluster import KMeans
    

    as of now, version 0.3.2 still don't have .inertia_ but I think it's in their TODO list.

    EDIT: Haven't tested yet, but scikit-cuda seems to be getting traction.

    EDIT: RAPIDS is really the way to go here.

    0 讨论(0)
提交回复
热议问题