urutu / Urutu

A Python based parallel programming library for GPUs
Apache License 2.0
7 stars 1 forks source link

Urutu with OpenCL #22

Open fermicro opened 8 years ago

fermicro commented 8 years ago

Hello, I'm writing my undergraduate final paper with OpenCL and I'm very interested in using Urutu.

I saw that the your paper is still under writing!

Does Urutu with OpenCL support any operation I would achieve normally with standard PyOpenCL?

Sievers

aditya4d commented 8 years ago

Hi, Most of the stuff. But not all. What specific operations or features are you looking for?

fermicro commented 8 years ago

I don't exactly know yet, I'll probably get more hands-into code next year. For now I'm researching a viable tool.

Do you have any prediction when your publication will be ready? You'd probably get 1 citation :)

Would it be possible if you explain to me examples of situations or operations I could not use Urutu?

Also, you commented on Twitter about Urutu's OpenCL being a bit slate, is that right?

Sievers

aditya4d commented 8 years ago

Hi, I may not be publishing it (may be forever). If you are interested, you can contribute to OpenCL backend and join as a co-author. Stale I meant, most of the ideas are implemented on CUDA backend.

fermicro commented 8 years ago

For around this year and next first portion I'll be focused on another work, which is a bit more high level for now, but I'm interested.

Would it be possible if you explain to me examples of situations or operations I could not use Urutu with OpenCL?

aditya4d commented 8 years ago

Hi, Its mostly, images, graphics interop, samplers and other fancy stuff.

fermicro commented 8 years ago

Hey, thanks for your support.

I'll mostly be doing calculations, with no graphics for now, then I believe I'd be good with Urutu CL.

Do you have an example with parallelism?

aditya4d commented 8 years ago

Hi, Here are the samples (I haven't tested them in a while) [1]. I am planning for a new system do my gpu development better. [1]. https://github.com/urutu/Urutu/tree/master/samples

fermicro commented 7 years ago

Hello again!

I am mostly taking as a reference your poster in GPU Conference and sample codes. If there is anything else I could study to learn more, please refer me!

Would you mind enlightening these for me, taking on account your first sample code:

@Urutu("CL")
def divmul(a, b, c, d):
    __global is x, y
    x = a[0:100]
    y = b[0:100]
    t, u, v, w = 10, 10.0, 'opencl', "open.cl"
    c[tx] = x[tx] / y[tx]
    d[tx] = x[tx] * y[tx]
    return c, d
  1. global and shared stand to types of memory allocation in OpenCL, is that correct?
  2. What do t, u, v, w , and tx stand for?
  3. On some other sample codes, also, bx or Tid are used, what do those stand for?
  4. A few samples get decorations as @Urutu("CL"), while others as @Urutu("GPU"). What exactly is their functioning? Which one one should use for running an OpenCL code in a GPU?
  5. I saw that keywords def, for, if etc. are supported. That means I could perform virtually anything I could ask for, inside an decorated @Urutu function. Are loops and other instructions dynamically handled inside the library so that code is parallelized within available cores? I have worked with parallelization with OpenMP and MPI, so I'd like to know whether code in Urutu will be automatically parallelized to Compute Units or that should be set manually.
  6. How is the hardware device chosen? I'd like to run the code in a particular GPU installed in the computer.

Thank you

aditya4d commented 7 years ago

Sorry for delayed response.

  1. The keywords map to same in OpenCL and to global and shared for CUDA
  2. It is a way to show how different types of data urutu can handle
  3. If you are familiar with CUDA thread hierarchy, bx is blockIdx.x, Tid is blockDim.x.
  4. Here are the mappings: CL - OpenCL, CU - CUDA, GPU - OpenCL/CUDA, CPU - CPU, auto - OpenCL/CUDA/CPU.
  5. Well, the compiler is good enough but not smart enough. It can handle simple def, for, if and all.
  6. Urutu checks for type of py package available. Example, on an NVIDIA system, if you install PyOpenCL, urutu selects only pyopencl eventhough the hardware supports CUDA.

Hope it helps.