OpenCLGA icon indicating copy to clipboard operation
OpenCLGA copied to clipboard

SomeFeatures

Open arita37 opened this issue 9 years ago • 7 comments

Hello,

This is an interesting project. Some questions:

  1. How PyOpenCL compatible with NVidia Card ?

  2. Is the objective function "converted/implemented" on the GPU side (evaluation is done on GPU) ?

Thanks, regards

arita37 avatar Dec 28 '16 15:12 arita37

As OpenCL is an open standard specification, each GPU vendor has its own corresponding OpenCL implementations. Vendor would also provide a share library (ICD loader) as the APIs entry dispatcher on target platform, for example, libOpenCL.so or libintelocl.so ... etc. So basically, if I understand correctly, in the native code of PyOpenCL, it communicate with the entry library, and you don't have to worry the rest of things : )

Basically, PyOpenCL (.py) <==> PyOpenCL (.so) <==> ICD loader ==> (Intel/NV/AMD) hardware.

kilikkuo avatar Dec 28 '16 17:12 kilikkuo

I assumed what you're saying "fitness function", in fact, yes ! We've implemented sample codes for reproduction / mutation / evaluation functions in C (based in C99, but not exactly compatible [1]), these codes will be built and executed on GPU.

[1] https://en.wikipedia.org/wiki/OpenCL

kilikkuo avatar Dec 28 '16 17:12 kilikkuo

Hi @arita37

The followings are my replies:

  1. How PyOpenCL compatible with NVidia Card ?

Yes, it is compatible with NVidia Card. We are using NVidia GPU Card for testing. If you are using NVidia Card, you may download the driver and get more information: here

  1. Is the objective function "converted/implemented" on the GPU side (evaluation is done on GPU) ?

Yes, the object must be implemented in C.

Don't worry. We will implement a compiler to convert objective function from python to C in the future, see #7 .

BTW, you may find our simple tsp example to know it is not hard to implement it in C.

john-hu avatar Dec 29 '16 01:12 john-hu

Hello,

Sounds good. What about having Python wrapper to use the library ?

PyGMO uses Python wrapper to encapsulate the C code. So this is very convenient.

Your project looks good.

Kind regards Kevin

On 29 Dec 2016, at 10:11, John Hu [email protected] wrote:

Hi @arita37

The followings are my replies:

How PyOpenCL compatible with NVidia Card ? Yes, it is compatible with NVidia Card. We are using NVidia GPU Card for testing. If you are using NVidia Card, you may download the driver and get more information: here

Is the objective function "converted/implemented" on the GPU side (evaluation is done on GPU) ? Yes, the object must be implemented in C.

Don't worry. We will implement a compiler to convert objective function from python to C in the future, see #7 .

BTW, you may find our simple tsp example to know it is not hard to implement it in C.

― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

arita37 avatar Dec 29 '16 05:12 arita37

@arita37

Thanks for the suggestion. I will check PyGMO to learn more on python wrapper since I am not a very good python programmer.....

john-hu avatar Dec 30 '16 02:12 john-hu

Hello,

Sounds good, I can help your project on Python wrapper.

Python has natural interface to C++ Pybingen 11 is a good one (better than Boost)

Best reference. for Python / PybinGen tutorial https://goo.gl/XnAjrx https://github.com/gjcarneiro/pybindgen

Also, there is PyCUDA in Python to create Cuda code... (using C++ code classes directly in Python), an example : https://goo.gl/ztd0AK

Cheers.

John Hu wrote:

@arita37 https://github.com/arita37

Thanks for the suggestion. I will check PyGMO to learn more on python wrapper since I am not a very good python programmer.....

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PyOCL/oclGA/issues/19#issuecomment-269723691, or mute the thread https://github.com/notifications/unsubscribe-auth/AR10p_hrt4e4JrecqysiijY79iFWm1C0ks5rNGvugaJpZM4LXAtj.

arita37 avatar Dec 30 '16 02:12 arita37

Great... It would be nice to have a python wrapper for the implementation of objective function.... If possible, please help us to have such kind of feature.

john-hu avatar Jan 25 '17 01:01 john-hu