如何让已经写好的并发程序在GPU阵列上运行?
我有一个用 Erlang 编写的神经网络,我刚刚购买了一张带有 240 核 GPU 的 GeForce GTX 260 卡。 使用 CUDA 作为粘合剂在显卡上运行它是否很简单?
I have a neural network written in Erlang, and I just bought a GeForce GTX 260 card with a 240 core GPU on it. Is it trivial to use CUDA as glue to run this on the graphics card?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,使用 CUDA 并不是一件小事。
CUDA 编程模型基本上使用 C(带有一些附加内容),但为了充分利用 GPGPU 的功能,您必须确保您的算法遵循 CUDA 指南。 (请参阅 NVidia CUDA 编程指南)
例如为了获得最佳内存性能(大约 70Gbps),您需要通过合并以流模式访问内存,而且分支在 GPU 上的成本非常高,因此您应该尽可能避免条件。 查看 SDK 附带的指南和示例,它们将提供一个很好的起点
No, using CUDA is not a trivial matter.
The CUDA programming model basically uses C (with some additions) but in order to get the most of the GPGPU's capabilities you would have to ensure that your algorithms follow the CUDA guidelines. (see NVidia CUDA Programming Guide)
For example in order to get the best memory performance (somewhere around 70Gbps) you need to access memory in streaming mode with coalescing, also branches are very costly on the GPUs so you should avoid conditionals as much as possible. Check out the guide and samples provided with the SDK, they'll provide an excellent starting point
我希望我能告诉您如何使用 Erlang 做到这一点...;-),但至少 MS Research 的 Satnam Singh 使用 Haskell (Lava) 和 F# 做了一些非常有趣的工作。 也许本文可以让您对如何完成它有一些直觉:
http://research.microsoft.com/en-us/people/satnams/
I wish I could tell you how to do this with Erlang... ;-), but at least, Satnam Singh at MS Research has done some very interesting work with Haskell (Lava) and F#. Perhaps this paper can give you some intuition for how it could be done:
http://research.microsoft.com/en-us/people/satnams/