用Xeon Phi进行并行处理,代码变化最小? [英] R Parallel Processing with Xeon Phi, minimal code changes?

查看:205
本文介绍了用Xeon Phi进行并行处理,代码变化最小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看看购买一对Xeon Phi 5110P,但是试图估计我有多少代码需要更改或者需要其他软件。

目前我很好的利用了<通过使用 foreach 包,在多核Windows机器(24核心)上执行code> R ,并将其他包传递给 forecast glmnet 等来做我的并行处理。



有了Xeon Phi我明白我想编译 R
https://software.intel.com/ en-us / articles / running-r-with-support-for-intel-xeon-phi-coprocessors 我知道这可以使用Parallel Studio XE的跟踪版本完成。



然后,我需要编辑R的Makeconf文件,添加C / C ++标志和Phi?在Parallel Studio过期之前编译所有需要的软件包?或者,我不需要编辑Makeconf以获得Phi上的 foreach 的好处吗?

看起来像这样的一些将会在R被编译后自动处理,由数学核心库(MKL)完成卸载,但我不完全确定这一点。



有点相关的问题:



另外revolutionanalytics.com似乎也有一些相关的博客文章,但不完全确定我: http: //blog.revolutionanalytics.com/2015/05/behold-the-power-of-parallel.html

解决方案

<如果您只需要进行矩阵运算,则可以在此处使用MKL库进行编译:[运行R,支持英特尔®至强融核™协处理器] [1],这需要英特尔编译器。 Microsoft R预先编译MKL,但我无法使用自动卸载,我不得不编译与英特尔编译器的R,它才能正常工作。



您可以使用试用版编译器并在试用期间进行编译,看看它是否适合您的目的。



如果您想使用 foreach 由于每个节点都是一台linux电脑,所以恐怕你运气不好。在[R-Admin] [1]的第3页上,它说


交叉构建是不可能的:安装R构建一个最小版本的然后运行许多
R脚本来完成构建。

您必须从xeon主机中为xeon phi这是不可行的。



使用Phi的最后一种方法是重写你的代码直接调用它。 Rcpp为C和C ++例程提供了一个简单的接口。如果您发现在xeon上运行良好的C例程,您可以调用代码中的节点。我已经用CUDA完成了这个工作,Rcpp是一个很薄的层次,并且有很好的例子说明了如何使用它,如果你通过调用phi卡节点的例子加入它,你可以用更少的开销实现你的目标。 >

如果你所需要的只是矩阵操作,那么在超级计算方面没有比一个好的双精度nvidea卡更快的路线,而是在R启动时预加载nvBlas。


Looking at buying a couple Xeon Phi 5110P, but trying to estimate how much code I have to change or other software needed.

Currently I make good use of R on a multi-core Windows machine (24 cores) by using the foreach package, passing it other packages forecast, glmnet, etc. to do my parallel processing.

Having a Xeon Phi I understand I would want to compile R https://software.intel.com/en-us/articles/running-r-with-support-for-intel-xeon-phi-coprocessors And I understand this could be done with a trail version of Parallel Studio XE.

Then do I then need to edit R's Makeconf file, adding the C/C++ flags and for the Phi? Compile all the needed packages before the trail on Parallel Studio expires? Or do I not need to edit the Makeconf to get the benefits of foreach on the Phi?

Seems like some of this will be handled automatically once R is compiled, with offloading done by the Math Kernel Library (MKL), but I'm not totally sure of this.

Somewhat related question: Is the Intel Xeon Phi usable without a costly Intel Compiler?

Also revolutionanalytics.com seems to have a few related blog posts but not entirely conclusive for me: http://blog.revolutionanalytics.com/2015/05/behold-the-power-of-parallel.html

解决方案

If all you need is matrix operations, you can compile it with MKL libraries per here: [Running R with Support for Intel® Xeon Phi™ Coprocessors][1] , which requires the Intel Complier. Microsoft R comes pre compiled with MKL but I was not able to use the auto offload, I had to compile R with the Intel compiler for it to work properly.

You could use the trial version compiler and compile it during the trial period to see if it fits your purpose.

If you want to use things like foreach package by setting up a cluster,since each node is a linux computer, I'm afraid you're out of luck. On page 3 of [R-Admin][1] it says

Cross-building is not possible: installing R builds a minimal version of R and then runs many R scripts to complete the build.

You have to cross compile from xeon host for xeon phi node with the intel compiler, and it's just not feasible.

The last way to utilize the Phi is to rewrite your code to call it directly. Rcpp provides an easy interface to C and C++ routines. If you found a C routine that runs well on xeon you can call the nodes within your code. I have done this with CUDA and the Rcpp is a thin layer and there are good examples of how to use it, and if you join it with examples of calling the phi card nodes you can probably achieve your goal with less overhead.

BUt, if all you need is matrix ops, there is no quicker route to supercomputing than a good double precision nvidea card and pre loading nvBlas during R startup.

这篇关于用Xeon Phi进行并行处理,代码变化最小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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