3 ms·
Thread level parallelism is different from GPU parallelism. Different threads can perform completely independent operations at any time. GPU threads must do exa
by lapink 7y ago
Thread level parallelism is different from GPU parallelism. Different threads can perform completely independent operations at any time. GPU threads must do exactly the same operations, but on different memory locations, at all time. In exchange for this rigidity, we can pack a lot more of them on silicon than CPU. A CPU thread is like a complete individual that can do anything they want. A GPU thread always is part of a pack, and they all move together.
The nice parallelism allowed by Clojure is for CPU threads not GPU threads. It would still need to rely on an external library for tensor operations, for instance ATen [1], the C++ backend of PyTorch.
On the other hand, Functional Programming can be useful to describe the model at a higher level and better handle the scheduling of each component (Convolution, LSTM, etc) on GPU. When training model, the batch size already allows near optimal usage of a GPU cores, however when doing evaluation, this becomes more relevant.
[1] https://pytorch.org/cppdocs/ https://pytorch.org/cppdocs/
- xpertmadman 7y agoWhile Clojure code itself is not running on the GPU, we still do have Deep Learning in Clojure enabled by Neanderthal/OpenCL. /u/dragandj is quite active here, you can ask him!