On Sun, 20 Jul 2008 09:54:39 -0700, mabshoff <[EMAIL PROTECTED]>  
wrote:

> On Jul 20, 9:21 am, Simon Beaumont <[EMAIL PROTECTED]> wrote:
>
> Hi Simon,
>
>> I am just about to embark on integrating come CUDA libraries into
>> sage. I was not sure of the best route to go - I am considering the
>> pycuda libraries as a starting point - this a pure kernel approach - I
>> but would also like to get the CUDA blas and fft libraries integrated.
>
> Various people have started looking into this, but so far no one has
> produced code. One big issue (at least for me) with pycuda is the
> requirement for boost, but I am not sure how that could be overcome.
> Since I am personally only interested in the CUDA BLAS the suggested
> way to hook it into Sage was directly via Cython, but recreating
> pycuda via Cython seems like a large waste of effort and should be
> avoided at all costs.

This will boil down to what you're trying to accomplish.  Exposing the  
full CUDA api to python might be a large task.  OTOH, building a  
capability using C/C++ CUDA and exposing a simplified API to SAGE through  
Cython might be straightforward and avoid some of the issues below.

Given the problems CUDA targets and the performance characteristics of the  
GPU/CPU/memory integration, its almost certain that a great deal of that  
interface needn't and shouldn't be pushed up through Cython into Python.

>
> The main issue with boost I see is that PolyBoRi ships with a subset
> of boost and installs it into $SAGE_LOCAL/include/boost. I assume that
> it will not be enough of boost, i.e. boost python is not part of it.
> Since PolyBoRi also has an interface to Python using boost Python we
> might be able to add the bits needed to the polybori.spkg, otherwise I
> see potentially huge trouble by colliding boost versions in the tree.
> And shipping boost itself is not really an option due to its rather
> large size.
>
>> (I think cuda-python) can do this. I'm sure I'm not the first down
>> this road and wondered which would be the most useful. I'd also
>> appreciate some tips and pointers into integration of sage arrays and
>> matrices to make this as native as possible.
>
> I think using numpy arrays here for now might be the way to go, but
> that limits you to numpy data types. Since we are talking about
> numerical computations it seems that we will not lose functionality
> here at all.

There's a GSOC activity looking at Python's buffer interface which is  
coordinated with the Cython activity

http://wiki.cython.org/enhancements/buffer

and is related to PEP 3118: http://www.python.org/dev/peps/pep-3118/

Travis Oliphant of Numpy fame is the author.

Putting a buffer api on top of CUDA might be a good place to start and  
given its broad use integrating C/C++ features throughout Python, you  
might get a lot of capability for free.  For example, mmap files expose a  
buffer interface.  The new buffer interface will likely provide those  
characteristics you seek from Numpy and Cython looks to be very interested  
in how to make it all work.

>
>> Of course this work would
>> be shared with the community. I have plans to make some CUDA hardware
>> available over the web using sage and have also have some longer term
>> plans for a modeling environment based on it.
>
> Cool. There are various people waiting to but the next generation of
> Tesla hardware, i.e. the one that actually provides IEEE doubles. I am
> basically waiting for it to become available since the things I am
> interested in do require IEEE precision and close to IEEE is not
> enough.
>
>> Any advice and pointers most welcome.
>
> Please keep us up to date how things are going and let us know about
> any problems you have. This is an area we should definitely make some
> progress this year.
>
>> Regards,
>>
>> Simon
>
> Cheers,
>
> Michael
> >

-- 
Glenn H. Tarbox, PhD || 206-494-0819 || [EMAIL PROTECTED]
"Don't worry about people stealing your ideas. If your ideas are any
  good you'll have to ram them down peoples throats" -- Howard Aiken

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to