16 ms·
Numba: High-Performance Python with CUDA Acceleration
- sandGorgon 9y agooh wow! does anyone know how this compares to julia CUDA performance ?
- code5fun 9y agonot even close baby ( ͡° ͜ʖ ͡°)
- littlepeter2 9y agoSo who is slower, numba or julia with cuda? And how do you know it is not even close?
- wallnuss 9y agoGiven that CUDAnative.jl is beating CUDA c in some benchmarks and in others it is a bit slower, I would suspect that NUMBA is similar in performance. The thing where the Julia CUDA support really shines is that it is supporting arbitrary Julia structs and not just a blessed few datatypes like Float32.
- lhenault 9y agoHow does this compare to CuPy (https://cupy.chainer.org/ https://cupy.chainer.org/) ? It is now independent from Chainer, is highly compatible with numpy and supports both CUDA and CuDNN.
- Loic 9y agoFor the CUDA part I cannot tell, but Numba is also compiling on the fly your Python code into machine code using LLVM. This where it shines. For example, instead of pushing your code into Cython or a Fortran library, you can keep writing in simple Python and get your code to run in some cases nearly as fast as Fortran. This is my use case. I haven't used the CUDA features yet.
- fnl 9y agoBut LLVM doesn't support vectorizing, like AVX or SSE4, right? So I don't think that would be nearly as fast as fully (Intel-) CPU optimized code... EDIT: Let me hedge that a bit, to advanced AVX instructions, as LLVM can do simple loops and such.
- lliiffee 9y agoI believe that LLVM 6 has finally introduced this, e.g. see http://llvm.org/docs/Vectorizers.html#vectorization-of-function-calls http://llvm.org/docs/Vectorizers.html#vectorization-of-funct...
- fnl 9y agoOh, cool, I see LLVM now even sports (basically all of) SSE4.2 and AVX-512. As always, that project amazes... :-)
- HelloNurse 9y agoDo you mean LLVM 5?
- fnl 9y agoYes, indeed even LLVM 4 already improved its AVX-512 support. http://releases.llvm.org/4.0.0/docs/ReleaseNotes.html http://releases.llvm.org/4.0.0/docs/ReleaseNotes.html Really impressive how many new things came to LLVM this year!
- Joky 9y agoUh, what you're pointing at was introduced in 2012 in LLVM.
- fnl 9y agoOnly in parts, not all instructions, and some functionality it did have was buggy. 4 and 5 are much more advanced/competitive on SIMD issues, it seems. Edit: Oh, sorry you meant that other guy's link to LLVM's vectorization tutorial. Ignore my reply ...
- dagw 9y agoOne advantage of Numba is that it doesn't require CUDA. You can easily write your code so that if the machine it's running on has CUDA then it will use that and if it doesn't it will just JIT it for the CPU.
- TheAlchemist 9y agoThis looks really good, however I struggle to find real applications for that. For almost all practical application, I use pandas or keras / tensorflow. I'm probably biased as I mostly work with simple data that doesn't require complicated calculations. Would somebody have some benchmarks against pandas for some standard operations ?
- 451mov 9y agodefinitely a lot faster than pandas! question: how do you debug a function which has a super complex decorator slapped on top of it?
- dagw 9y agoquestion: how do you debug a function which has a super complex decorator slapped on top of it? With difficulty. If you find yourself in a situation where you have a function that works without the numba decorator, but fails with it then it's time to break out your llvm reading skills: http://numba.pydata.org/numba-doc/0.10/annotate.html http://numba.pydata.org/numba-doc/0.10/annotate.html That being said it is very rare that that happens.
- marmaduke 9y agoYou can just remove the decorator?
- glup 9y agoNo, because certain things are fine in an interpreted function that will fail to compile, and throw totally uninformative errors. E.g., one time I spent about 3 hours trying to figure out why a relatively simple, perfectly functional Numpy function, limited to the subset of Numba primitives wouldn't compile. A labmate with actual knowledge of C looked at the code and in about 30 seconds suggested it might be having two return statements; she was of course correct that this was the problem. Doh.
- anc84 9y ago(2013)
- grej 9y agoSee the note at the top of the article: Note, this post was originally published September 19, 2013. It was updated on September 19, 2017.
- p1esk 9y agoSo, what exactly was updated?
- bsprings 9y agoWhen I originally wrote the post in 2013, the GPU compilation part of Numba was a product (from Anaconda Inc., nee Continuum Analytics) called NumbaPro. It was part of a commercial package called Anaconda Accelerate that also included wrappers for CUDA libraries like cuBLAS, as well as MKL acceleration on the CPU. Continuum gradually open sourced all of it (and changed their name to Anaconda). The compiler functionality is all open source within Numba. Most recently they released the CUDA library wrappers in a new open source package called pyculib. Some other minor things changed, such as what you need to import. Also, the autojit and cudajit functionality is a bit better at type inference, so you don't have to annotate all the types to get it to compile. We thought it was a good idea to update the post in light of all the changes.
- moon_of_moon 9y agoReal nice NVidia. Now how about some support for Linux on Optimus/Hybrid GPU laptops?
- jhasse 9y agoStop buying them ;)
- MagicStickOne 9y agoGreat1
- m3kw9 9y agoSo what happens if it runs in something like jupyter notebook mixed with runtime code?
- marmaduke 9y agoIt works fine.
- pavanky 9y agoI'd also like to shamelessly point out something I work on: https://github.com/arrayfire/arrayfire-python https://github.com/arrayfire/arrayfire-python It is a python wrapper around https://github.com/arrayfire/arrayfire https://github.com/arrayfire/arrayfire and allows the code you write to use CUDA, OpenCL or x86.
- QuadmasterXLII 9y agoI've used this, it is surprisingly intuitive-- Thanks for making it!
- snthpy 9y agoSounds great! However without having looked at the API, my first reaction is that it's yet another interface to learn. What would be awesome is if I could just take my existing numpy or theano code and drop in an arrayfire object. Is that possible or how similar is the API?