OpenSHMEM and OpenCL

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

OpenSHMEM and OpenCL

Postby Farzaneh » Tue Jan 10, 2017 2:55 pm

Dear Jar,

In the paper:
https://arxiv.org/pdf/1608.03549v1.pdf

it says that OpenSHMEM + OpenCL can work on Parallella. Is it possible to to find some examples / documentation regarding this?

Additionally, is it possible to obtain the source code of the benchmarks evaluated in this paper as the Matrix Multiplication example in:
https://github.com/openshmem-org/opensh ... m_matrix.c

does not have the kernel launch code.


Thanks in advance,
Farzaneh
Farzaneh
 
Posts: 13
Joined: Thu Dec 22, 2016 5:44 am

Re: OpenSHMEM and OpenCL

Postby jar » Tue Jan 10, 2017 4:26 pm

I have not published any examples because I dislike OpenCL as a programming model for Epiphany. I don't want to enable people to make poor choices. Why do you want to do this? You seem like a nice person...please don't use OpenCL.

I will publish the OpenSHMEM matrix-matrix multiplication code for Epiphany soon. It's built on top of BDT's COPRTHR-2. There's some refactoring going on with COPRTHR-2 right now to bring it up to the new Parabuntu 2016.11 image and the new Epiphany ABI. That code is similar to this code: https://github.com/browndeer/coprthr2-e ... on_tfunc.c (this was the threaded MPI example code I developed before the OpenSHMEM library)

IIRC, the OpenSHMEM-based Cannon's matrix-matrix multiplication achieved 14+ GFLOPS (~75% peak performance) and was/is the highest performing C code to date. This was on the old 2015.1 image with gcc 4.8. Early data suggests gcc 5.4 on the new 2016.11 image is paying dividends so that number may even go up.

The history of Epiphany-related SDK development goes sort of like this (I probably have the dates wrong):
<2011 Adapteva eSDK development. Specialized for Epiphany
~2012 Adapteva needs OpenCL because it's a marketing buzzword and seems like it could work because Epiphany is a coprocessor
~2013 Browndeer Technology delivers OpenCL
~2014 Realization that OpenCL lacks semantics for exploiting Epiphany for non-trivial parallelism, initial threaded MPI experiment by BDT
2015 ARL/BDT Published early results of threaded MPI for Epiphany. Threaded MPI was a partial implementation of MPI. MPI is a huge standard with things that don't really apply to Epiphany. Reviewers liked it but asked: why not OpenSHMEM since it seems to be a better fit? Hmm...Yes, WHY NOT OpenSHMEM???
2016 ARL OpenSHMEM for Epiphany development with COPRTHR-2 SDK improvements

I think we have a pretty good model now that exploits most of the capabilities of the architecture and is pretty close to how Adapteva envisioned programming it. In some cases, you can have completely portable OpenSHMEM code running on Epiphany. You can literally recompile the same C code and have it work on Epiphany cores or a 100,000 core supercomputer. OpenSHMEM is an industry standard adopted by many organizations and SHMEM has been around since the 1990s. I believe it works better than any other device-side API we've seen so far. However, it doesn't address the problem with coprocessor offload. OpenCL and COPRTHR-2 both address offload, but OpenCL is just so heavyweight for Parallella. Both COPRTHR-2 and OpenCL also have a device-side API, but OpenCL's device model doesn't fit well and the current COPRTHR-2 device side API is comparatively basic and lacks the capabilities of OpenSHMEM. The ARL OpenSHMEM for Epiphany implementation has a huge number of builtin collective, atomic, memory movement, and reduction operations missing from every other device-side API for Epiphany (Epiphany BSP might be second).

COPRTHR-2 (host) + OpenSHMEM (device) is my recommendation.

Edit - To be fair, I should mention that the COPRTHR-2 device side API does things that OpenSHMEM does not address such as printf, other host/system side calls, dynamic program calls, logarithmic program loader, memory management, etc. Much of this "magic" happens transparently to the programmer and is orthogonal to the parallel algorithm development enabled by OpenSHMEM. The works are complementary.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: OpenSHMEM and OpenCL

Postby Farzaneh » Wed Jan 11, 2017 3:28 am

Thank you Jar for your prompt reply
Farzaneh
 
Posts: 13
Joined: Thu Dec 22, 2016 5:44 am


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 1 guest

cron