ANN: PyViennaCL 1.0.3 -- very easy GPGPU linear algebra

Hello everybody, I am pleased to announce the 1.0.3 release of PyViennaCL! This release fixes a number of important bugs, and improves performance on nVidia Kepler GPUs. The ChangeLog is below, and the associated ViennaCL version is 1.5.2. About PyViennaCL ================ *PyViennaCL* aims to make fast, powerful GPGPU and heterogeneous scientific computing really transparently easy, especially for users already using NumPy for representing matrices. PyViennaCL does this by harnessing the `ViennaCL <http://viennacl.sourceforge.net/>`_ linear algebra and numerical computation library for GPGPU and heterogeneous systems, thereby making available to Python programmers ViennaCL’s fast *OpenCL* and *CUDA* algorithms. PyViennaCL does this in a way that is idiomatic and compatible with the Python community’s most popular scientific packages, *NumPy* and *SciPy*. PyViennaCL exposes the following functionality: * sparse (compressed, co-ordinate, ELL, and hybrid) and dense (row-major and column-major) matrices, vectors and scalars on your compute device using OpenCL; * standard arithmetic operations and mathematical functions; * fast matrix products for sparse and dense matrices, and inner and outer products for vectors; * direct solvers for dense triangular systems; * iterative solvers for sparse and dense systems, using the BiCGStab, CG, and GMRES algorithms; * iterative algorithms for eigenvalue estimation problems. PyViennaCL has also been designed for straightforward use in the context of NumPy and SciPy: PyViennaCL objects can be constructed using NumPy arrays, and arithmetic operations and comparisons in PyViennaCL are type-agnostic. See the following link for documentation and example code: http://viennacl.sourceforge.net/pyviennacl/doc/ Get PyViennaCL ============== PyViennaCL is easily installed from PyPI. If you are on Windows, there are binaries for Python versions 2.7, 3.2, 3.3, and 3.4. If you are on Mac OS X and want to provide binaries, then please get in touch! Otherwise, the installation process will build PyViennaCL from source, which can take a while. If you are on Debian or Ubuntu, binaries are available in Debian testing and unstable, and Ubuntu utopic. Just run:: apt-get install python-pyviennacl python3-pyviennacl To install PyViennaCL from PyPI, make sure you've got a recent version of the *pip* package manager, and run:: pip install pyviennacl Bugs and support ================ If you find a problem in PyViennaCL, then please report it at https://github.com/viennacl/pyviennacl-dev/issues ChangeLog ========= 2014-05-15 Toby St Clere Smithe <pyviennacl@tsmithe.net> * Release 1.0.3. * Update external/viennacl-dev to version 1.5.2. [91b7589a8fccc92927306e0ae3e061d85ac1ae93] This contains two important fixes: one for a build failure on Windows (PyViennaCL issue #17) relating to the re-enabling of the Lanczos algorithm in 1.0.2, and one for an issue relating to missing support for matrix transposition in the ViennaCL scheduler (PyViennaCL issue #19, ViennaCL issue #73). This release is also benefitial for performance on nVidia Kepler GPUs, increasing the performance of matrix-matrix multiplications to 600 GFLOPs in single precision on a GeForce GTX 680. * Fix bug when using integers in matrix and vector index key [dbb1911fd788e66475f5717c1692be49d083a506] * Fix slicing of dense matrices (issue #18). [9c745710ebc2a1066c7074b6c5de61b227017cc6] * Enable test for matrix transposition [9e951103b883a3848aa2115df3edce73d347c09b] * Add non-square matrix-vector product test [21dd29cd10ebe02a96ee23c20ee55401bc6c874f] 2014-05-06 Toby St Clere Smithe <pyviennacl@tsmithe.net> * Release 1.0.2. * Re-enable Lanczos algorithm for eigenvalues (issue #11). [cbfb41fca3fb1f3db42fd7b3ccb8332b701d1e20] * Enable eigenvalue computations for compressed and coordinate matrices. [8ecee3b200a92ae99b72653a823c1f60e62f75dd] * Fix matrix-vector product for non-square matrices (issue #13). [bf3aa2bf91339df72b6f7561afaf8b12aad57cda] * Link against rt on Linux (issue #12). [d5784b62b353ebbfd78fe1335fd96971b5089f53] Best regards, -- Toby St Clere Smithe http://tsmithe.net

Hi Toby,
If you are on Mac OS X and want to provide binaries, then please get in touch! Otherwise, the installation process will build PyViennaCL from source, which can take a while.
I could contribute, though I just opened an issue about a compilation error on Mavericks 10.9.3. Curiously, the source install seems OK on Lion 10.7.5 Cheers, JB

Hi JB, Marquette Jean-Baptiste <marquett@iap.fr> writes:
I could contribute, though I just opened an issue about a compilation error on Mavericks 10.9.3. Curiously, the source install seems OK on Lion 10.7.5
Great! The issue is because Mavericks has a more recent version of clang than Lion, and the recent version baulks at something technical in boost's C++ usage that I can't quite be bothered to understand. Anyway, I've cherry-picked a fix, if you'd like to try building from git. If that works, then we could probably cheat, and call that build 1.0.3 as well, since there are no material changes to PyViennaCL itself. Would you be happy to build Python wheels? It's very simple: just `setup.py bdist_wheel` if you have the wheel module installed. Cheers, -- Toby St Clere Smithe http://tsmithe.net

Hi, On Sun, May 18, 2014 at 10:05 AM, Toby St Clere Smithe <pyviennacl@tsmithe.net> wrote:
Hi JB,
Marquette Jean-Baptiste <marquett@iap.fr> writes:
I could contribute, though I just opened an issue about a compilation error on Mavericks 10.9.3. Curiously, the source install seems OK on Lion 10.7.5
Great! The issue is because Mavericks has a more recent version of clang than Lion, and the recent version baulks at something technical in boost's C++ usage that I can't quite be bothered to understand. Anyway, I've cherry-picked a fix, if you'd like to try building from git.
If that works, then we could probably cheat, and call that build 1.0.3 as well, since there are no material changes to PyViennaCL itself. Would you be happy to build Python wheels? It's very simple: just `setup.py bdist_wheel` if you have the wheel module installed.
That works for me with the patch. I suggest building the wheel against the python.org python; the wheel is then compatible with system python, homebrew etc - see : https://github.com/MacPython/wiki/wiki/Spinning-wheels I then rename the wheel to express the fact it is compatible with these versions, with something like the attached script. This ends up renaming the default output wheel: pyviennacl-1.0.3-cp27-none-macosx_10_6_intel.whl to this: pyviennacl-1.0.3-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl Here are checks showing that this build / rename process does in fact work for homebrew, macports for numpy / scipy / matplotlib / pandas etc (the failures are real test failures, not packaging errors): https://travis-ci.org/matthew-brett/scipy-stack-osx-testing/builds/25131865 (thanks to Matt Terry for the basis of the script to do this testing). I checked with the `delocate` `delocate-listdeps` utility, and you are only linking to stuff in the OSX System directories, and you don't need to use `delocate-wheel`. Cheers, Matthew

Typically, I have multiple CPU cores running in 'trivial parallel' mode - each running an independent point of a monte-carlo simulation. Could multiple processes multiplex use of a single GPU, using PyViennaCL?

Hi Neal, Neal Becker <ndbecker2@gmail.com> writes:
Typically, I have multiple CPU cores running in 'trivial parallel' mode - each running an independent point of a monte-carlo simulation.
Could multiple processes multiplex use of a single GPU, using PyViennaCL?
As long as your OpenCL implementation allows more than one process to access the compute device simultaneously, I don't see why this shouldn't work. I just made a basic test of this using nVidia's OpenCL implementation by running two PyViennaCL processes at once, and nothing went awry. ViennaCL has fairly loose object ownership requirements, so I expect you'd even be able to pass objects between the processes as long as the pointers were maintained. I'd be interested to hear how this goes. Cheers, -- Toby St Clere Smithe http://tsmithe.net

Hey, thanks for providing windows binaries, i never was able to build vienna cl on my own. Big question: is there interoperability between pyopencl and pyviennacl? I don't want to copy these big arrays around, especially if they are already on the device. greetings Till

Hi Till, Till Stensitzki <tillsten@zedat.fu-berlin.de> writes:
thanks for providing windows binaries, i never was able to build vienna cl on my own. Big question: is there interoperability between pyopencl and pyviennacl? I don't want to copy these big arrays around, especially if they are already on the device.
Actually, I'm going to be working on that interoperability over the next couple of months, so it should be there by July -- and at that point it should be pretty simple to convert a PyOpenCL buffer to a ViennaCL matrix (for instance). But right now, indeed, you'll probably have to cope without that functionality.. Cheers, -- Toby St Clere Smithe http://tsmithe.net

Just to say that, thanks to Matthew Brett, binary wheels for Mac OS X are now available, for Python versions 2.7, 3.3, and 3.4. This means that, if you're on that platform, you won't have to build from source! As usual, just run `pip install pyviennacl`, and please report any issues you encounter to https://github.com/viennacl/pyviennacl-dev/issues ! Thanks, Toby Toby St Clere Smithe <pyviennacl@tsmithe.net> writes:
Hello everybody,
I am pleased to announce the 1.0.3 release of PyViennaCL! This release fixes a number of important bugs, and improves performance on nVidia Kepler GPUs. The ChangeLog is below, and the associated ViennaCL version is 1.5.2.
About PyViennaCL ================
*PyViennaCL* aims to make fast, powerful GPGPU and heterogeneous scientific computing really transparently easy, especially for users already using NumPy for representing matrices.
PyViennaCL does this by harnessing the `ViennaCL <http://viennacl.sourceforge.net/>`_ linear algebra and numerical computation library for GPGPU and heterogeneous systems, thereby making available to Python programmers ViennaCL’s fast *OpenCL* and *CUDA* algorithms. PyViennaCL does this in a way that is idiomatic and compatible with the Python community’s most popular scientific packages, *NumPy* and *SciPy*.
PyViennaCL exposes the following functionality:
* sparse (compressed, co-ordinate, ELL, and hybrid) and dense (row-major and column-major) matrices, vectors and scalars on your compute device using OpenCL; * standard arithmetic operations and mathematical functions; * fast matrix products for sparse and dense matrices, and inner and outer products for vectors; * direct solvers for dense triangular systems; * iterative solvers for sparse and dense systems, using the BiCGStab, CG, and GMRES algorithms; * iterative algorithms for eigenvalue estimation problems.
PyViennaCL has also been designed for straightforward use in the context of NumPy and SciPy: PyViennaCL objects can be constructed using NumPy arrays, and arithmetic operations and comparisons in PyViennaCL are type-agnostic.
See the following link for documentation and example code: http://viennacl.sourceforge.net/pyviennacl/doc/
Get PyViennaCL ==============
PyViennaCL is easily installed from PyPI.
If you are on Windows, there are binaries for Python versions 2.7, 3.2, 3.3, and 3.4.
If you are on Mac OS X and want to provide binaries, then please get in touch! Otherwise, the installation process will build PyViennaCL from source, which can take a while.
If you are on Debian or Ubuntu, binaries are available in Debian testing and unstable, and Ubuntu utopic. Just run::
apt-get install python-pyviennacl python3-pyviennacl
To install PyViennaCL from PyPI, make sure you've got a recent version of the *pip* package manager, and run::
pip install pyviennacl
Bugs and support ================
If you find a problem in PyViennaCL, then please report it at https://github.com/viennacl/pyviennacl-dev/issues
ChangeLog =========
2014-05-15 Toby St Clere Smithe <pyviennacl@tsmithe.net>
* Release 1.0.3.
* Update external/viennacl-dev to version 1.5.2. [91b7589a8fccc92927306e0ae3e061d85ac1ae93]
This contains two important fixes: one for a build failure on Windows (PyViennaCL issue #17) relating to the re-enabling of the Lanczos algorithm in 1.0.2, and one for an issue relating to missing support for matrix transposition in the ViennaCL scheduler (PyViennaCL issue #19, ViennaCL issue #73).
This release is also benefitial for performance on nVidia Kepler GPUs, increasing the performance of matrix-matrix multiplications to 600 GFLOPs in single precision on a GeForce GTX 680.
* Fix bug when using integers in matrix and vector index key [dbb1911fd788e66475f5717c1692be49d083a506]
* Fix slicing of dense matrices (issue #18). [9c745710ebc2a1066c7074b6c5de61b227017cc6]
* Enable test for matrix transposition [9e951103b883a3848aa2115df3edce73d347c09b]
* Add non-square matrix-vector product test [21dd29cd10ebe02a96ee23c20ee55401bc6c874f]
2014-05-06 Toby St Clere Smithe <pyviennacl@tsmithe.net>
* Release 1.0.2.
* Re-enable Lanczos algorithm for eigenvalues (issue #11). [cbfb41fca3fb1f3db42fd7b3ccb8332b701d1e20]
* Enable eigenvalue computations for compressed and coordinate matrices. [8ecee3b200a92ae99b72653a823c1f60e62f75dd]
* Fix matrix-vector product for non-square matrices (issue #13). [bf3aa2bf91339df72b6f7561afaf8b12aad57cda]
* Link against rt on Linux (issue #12). [d5784b62b353ebbfd78fe1335fd96971b5089f53]
Best regards,
-- Toby St Clere Smithe http://tsmithe.net
participants (5)
-
Marquette Jean-Baptiste
-
Matthew Brett
-
Neal Becker
-
Till Stensitzki
-
Toby St Clere Smithe