使用GPU加速MATLAB代码? [英] Accelerating MATLAB code using GPUs?

查看:708
本文介绍了使用GPU加速MATLAB代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AccelerEyes在2012年12月宣布,它可以在GPU代码上与Mathworks一起使用,并且已停止其产品MATLAB的Jacket:

AccelerEyes announced in December 2012 that it works with Mathworks on the GPU code and has discontinued its product Jacket for MATLAB:

http://blog.accelereyes.com /blog/2012/12/12/exciting-updates-from-accelereyes/

不幸的是,他们不再出售夹克许可证.

Unfortunately they do not sell Jacket licences anymore.

据我了解,基于ArrayFire的Jacket GPU阵列解决方案比MATLAB提供的gpuArray解决方案要快得多.

As far as I understand, the Jacket GPU Array solution based on ArrayFire was much faster than the gpuArray solution provided by MATLAB.

我开始使用gpuArray,但是我发现许多功能实现不佳.例如一个简单的

I started working with gpuArray, but I see that many functions are implemented poorly. For example a simple

myArray(:) = 0 

非常慢.我已经编写了一些自定义的CUDA内核,但是,即使在整个代码中始终使用gpuArrays,标准MATLAB功能的实现也很差.我通过用手写的CUDA代码替换MATLAB代码来解决了一些问题-但我不想重新实现MATLAB标准功能.

is very slow. I have written some custom CUDA-Kernels, but the poorly-implemented standard MATLAB functionality adds a lot of overhead, even if working with gpuArrays consistently throughout the code. I fixed some issues by replacing MATLAB code with hand written CUDA code - but I do not want to reimplement the MATLAB standard functionality.

我缺少的另一个功能是稀疏的GPU矩阵.

Another feature I am missing is sparse GPU matrices.

所以我的问题是:

如何加快MATLAB提供的错误实施的默认GPU实现的速度?特别是,如何使用GPU加快MATLAB中的稀疏矩阵运算?

How do is speed up the badly implemented default GPU implementations provided by MATLAB? In particular, how do I speed up sparse matrix operations in MATLAB using the GPU?

推荐答案

我很高兴参加AccelerEyes创始人John的演讲.他们之所以没有获得提速,是因为他们只是删除了写得不好的代码,并用在这里和那里节省了几分的代码代替了它们.他们的提速主要来自于利用缓存的可用性并在内存中执行了大量操作(GPU).如果我没记错的话,Matlab依靠在GPU和CPU之间传输数据,因此加速非常疯狂.

I had the pleasure of attending a talk by John, the founder of AccelerEyes. They did not get the speedup because they just removed poorly written code and replaced it with code that saved a few bits here and there. Their speedup was mostly from exploiting the availability of cache and doing a lot of operations in-memory (GPU's). Matlab relied on transferring data between GPU and CPU, if I remember correctly, and hence the speedup was crazy.

这篇关于使用GPU加速MATLAB代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆