Questions tagged [numba-pro]

NumbaPro - enhanced version of Numba, adding GPU support

NumbaPro is an enhanced version of Numba which adds premium features and functionality that allow developers to rapidly create optimized code that integrates well with NumPy.

With NumbaPro, Python developers can define NumPy ufuncs and generalized ufuncs (gufuncs) in Python, which are compiled to machine code dynamically and loaded on the fly. Additionally, NumbaPro offers developers the ability to target multicore and GPU architectures with Python code for both ufuncs and general-purpose code.

For targeting the GPU, NumbaPro can either do the work automatically, doing its best to optimize the code for the GPU architecture. Alternatively, CUDA-based API is provided for writing CUDA code specifically in Python for ultimate control of the hardware (with thread and block identities).

Here’s a list of highlighted features:

Portable data-parallel programming through ufuncs and gufuncs for single core CPU, multicore CPU and GPU Bindings to CUDA libraries: cuRAND, cuBLAS, cuFFT Python CUDA programming for maximum control of hardware resources

References:

79 questions
1
vote
0 answers

All possible signatures with numba vectorize

I am new to Numba and GPU programming with Python. I understand basic signatures used with vectorize decorator. For example :- For a method that accepts two float variables and return a float , this is the signature @vectorize([float64(float64,…
RandomWanderer
  • 701
  • 2
  • 12
  • 23
1
vote
1 answer

How to calculate logarithm in GPU(python3.5+numba+CUDA8.0)

I calculated logarithm in GPU with math.log, which is one of the Supported Python features in CUDA Python. But failed. My code: import os,sys,time,math import pandas as pd import numpy as np from numba import cuda, float32 import os bpg = (3,1)…
glen
  • 197
  • 1
  • 4
  • 13
1
vote
1 answer

How to get CUDA to work with python 3.5 and numba

By running the code: import numba numba.cuda.api.detect() I get the error: Traceback (most recent call last): File "", line 1, in numba.cuda.api.detect() File…
1
vote
1 answer

NumbaPro - Smartest way to sort a 2d array and then sum over entries of same key

In my program I have an array with the size of multiple million entries like this: arr=[(1,0.5), (4,0.2), (321, 0.01), (2, 0.042), (1, 0.01), ...] I could instead make two arrays with the same order (instead of an array with touples) if that…
Escapado
  • 117
  • 2
  • 12
1
vote
1 answer

NumaPro Cuda Device Function - Return multiple Arrays and local memory

Does anyone know what the correct syntax for the cuda.jit decorator is if you want to write a device function that returns multiple arrays? If my device function should return one float and had two integer parameters my decorator would…
Escapado
  • 117
  • 2
  • 12
1
vote
1 answer

Arrays in CUDA Kernels using Python with numba-pro

I'm currently writing code that can be heavily parallelized using GPUs. My code structure essentially looks like this: Create two arrays, let's call them A and B of length N. (CPU) Perform NxN calculations that eventually return a scalar. These…
ICST
  • 21
  • 1
  • 5
1
vote
0 answers

Calling one GPU kernel from another with NumbaPro

I wish to make a call from one GPU kernel to another: import numpy from numbapro import vectorize sig = 'int16(int16, int16)' @vectorize([sig], device=True, target='gpu') def sum(a, b): return a + b @vectorize([sig], target='gpu') def…
1
vote
1 answer

NumbaPro on Cuda device over ssh connection

I'm using Python/NumbaPro to use my CUDA complient GPU on a windows box. I use Cygwin as shell and from within a cygwin console it has no problems finding my CUDA device. I test with the simple command numbapro.check_cuda() But when I'm…
1
vote
0 answers

Error invalid value when using CUDA

I am trying to run an example program I found here: import numpy as np from timeit import default_timer as timer from numbapro import vectorize @vectorize(["float32(float32, float32)"], target='gpu') def VectorAdd(a, b): return a + b def…
Charles
  • 947
  • 1
  • 15
  • 39
1
vote
2 answers

Numbapro stopped working on the gpu

I'm trying to run the following program: import numpy as np from timeit import default_timer as timer from numbapro import vectorize @vectorize(["float32(float32, float32)"], target='gpu') def VectorAdd(a,b): return a + b def main(): …
Stein
  • 3,179
  • 5
  • 27
  • 51
1
vote
0 answers

Autojit - how to increase performance for rotating

I have the following code: def rotation_cpu(img, theta, dst): cosTheta = np.cos(theta) sinTheta = np.sin(theta) for i in range(512): for j in range(512): xpos = cosTheta * i - sinTheta * j ypos = sinTheta…
FacundoGFlores
  • 7,858
  • 12
  • 64
  • 94
1
vote
2 answers

TypeError: Arrays must have consistent types in assignment

Following up from here, I've got code like the following: @jit(float_[:,:,:](float_[:,:], int_[:], int_)) def train_function(X, y, H): # do lots of stuff, including setting the arrays g and g_per_round like this: g = np.zeros((no_features,…
user961627
  • 12,379
  • 42
  • 136
  • 210
1
vote
1 answer

list index error with numba guvectorize

I am new to numba / numbapro. I was trying to run one of the examples, this one about generalised Ufuncs with guvectorize: (Here the link to the example): http://docs.continuum.io/numbapro/quickstart.html#numbapro-guvectorize import numbapro as…
AlexNoir
  • 789
  • 3
  • 8
  • 20
1
vote
1 answer

Computer freezes after running Numbapro CUDA code

Can anyone explain to me why everytime I run this code, my computer freeze? from numbapro import cuda import numpy as np from timeit import default_timer as time n = 100 dtype = np.float32 @cuda.jit('void(float32[:,:], float32[:],…
kirikoumath
  • 723
  • 9
  • 20
1
vote
2 answers

Converting function to NumbaPro CUDA

I am comparing several Python modules/extensions or methods for achieving the following: import numpy as np def fdtd(input_grid, steps): grid = input_grid.copy() old_grid = np.zeros_like(input_grid) previous_grid =…
FRidh
  • 182
  • 7