在 Matlab 中通过多个 GPU 处理大型密集矩阵

发布于 2025-01-17 11:10:26 字数 410 浏览 2 评论 0原文

只是矩阵 A 乘以矩阵 B(以及其他简单的运算),但每个矩阵(A 或 B)对于单个 GPU 来说都很大,无法存储。

A = rand(10000,10000)
A = distributed(A)
spmd
%     gpuDevice
    A = gpuArray(A)
    
end

我的解决方案失败了,因为“GPU 阵列仅支持基本的数字或逻辑数据类型”。

如果我手动将矩阵的一部分分配给每个GPU,我必须自己处理GPU(矩阵的每个部分)之间的通信时间,而且,我不能直接使用很多函数,例如eig或max。

我不知道matlab是否已经有一些解决方案(就像使用分布式数组来处理每个工作之间的通信时间一样)来处理这个问题。

Just matrix A times matrix B(and other simple operations), but each matrix (A or B) is so large for a single GPU to store.

A = rand(10000,10000)
A = distributed(A)
spmd
%     gpuDevice
    A = gpuArray(A)
    
end

My solution is failed, due to "GPU arrays support only fundamental numeric or logical data types."

If I manually distribute parts of the matrix to the each GPU,I have to deal with communication time between GPUs (each parts of my matrix) by myself, furthermore, I can't use lots of funtions such as eig or max directly.

I have no idea whether matlab already have some solution (just like using distributed array to deal with communication time between each works) to handle this problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文