3

I am really amazed by the julia language, having implemented lots of machine learning algorithms there for my current project. Even though julia 0.2 manages to get some great results out of my 2011 MBA outperforming all other solutuions on similar linux hardware (due to vecLib blas, i suppose), I would certainly like more. I am in a process of buying radeon 5870 and would like to push my matrix operations there. I use basically only simple BLAS operations such as matmul, additios and transpositions. I use julia's compact syntax A' * B + C and would certainly like to keep it.

Is there any way (or pending milestone) I can get those basic operations execute on GPU? I have like 2500x2500 single precision matrices so I expect significant speedup.

Michael Ohlrogge
  • 10,559
  • 5
  • 48
  • 76
Terminus
  • 925
  • 10
  • 23

1 Answers1

4

I don't believe that GPU integration into the core of Julia is planned at this time. One of the key issues is that there is substantial overhead moving the data to and from the GPU, making a drop-in replacement for BLAS operations infeasible.

I expect that most of the progress in this area will actually come from the package ecosystem, in particular packages under the JuliaGPU organization. I see there is a CLBLAS package in there.

IainDunning
  • 11,546
  • 28
  • 43
  • Yes, I saw CLBlas. However, one of the primary advatages of julia is her clean syntax. I can use OpenCL in C or fortran, but it's no fun. Libraries like CLBlas add obscure syntax and this is horrible. I am sure this can be figured out, but am sad that it didn't happen as yet. – Terminus Jul 15 '14 at 19:55
  • On second thought, maybe a could hide some syntax ugliness with macros... But still, replacing linear algebra methods at deeper level would be much much better. – Terminus Jul 15 '14 at 20:06
  • There are certainly _other_ BLAS libraries available for other languages, so if Julia can interoperate with any of those languages you should be able to access them. I don't know Julia, but if it has some kind of operator overloading you should be able to wrap the external library with your nice syntax. – Dithermaster Jul 16 '14 at 00:01
  • 2
    Julia can use other BLAS libraries, and does have "operator overloading". This isn't the issue though. The question was whether you could just drop-in replace the default BLAS with a GPU powered one - the answer is no, because the overhead of moving the data to/from the GPU would probably exceed any benefit in most cases. The correct way is to, in a package, define a GPUMatrix type, provide a method to explicitly convert a Matrix to a GPUMatrix, then define + * etc for GPUMatrix to use e.g. CLBLAS. If this doesn't exist already, I don't think it'd be hard to get started. – IainDunning Jul 16 '14 at 15:15