Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
134 views

I'm writing some Hamiltonian evolution code that relies heavily on matrix multiplication, so I've been trying to learn about developing for a GPU using python. However, when I run these lines of code ...
user2506833's user avatar
0 votes
1 answer
138 views

I want to have a factory method that calls a cfunc using numpy arrays. I am trying to pass the numpy arrays by using a ctype pointer. Since my original code is rather complicated I have made a simple ...
Miguel Madeira's user avatar
1 vote
1 answer
130 views

This Python 3.13.5 script with numpy 2.2.6 and numba 0.61.2: import numpy as np, numba as nb @nb.njit(fastmath=True) def f(a, b): return np.histogram(a, 10, weights=b) a = np.random.randint(0, 256,...
Paul Jurczak's user avatar
  • 8,630
2 votes
1 answer
194 views

This Python 3.12.7 script with NumPy 2.2.4 and Numba 0.61.2: import numpy as np, timeit as ti, numba as nb def f0(a): p0 = a[:-2] p1 = a[1:-1] p2 = a[2:] return (p0 < p1) & (p1 > p2) ...
Paul Jurczak's user avatar
  • 8,630
4 votes
0 answers
232 views

Aim: I want to finetune parakeet v2 model to a different dataset. I picked LJ dataset just to make myself familiar with the finetuning process. For doing this I ran the following notebook This works ...
Deepanshu Yadav's user avatar
0 votes
0 answers
116 views

I'm trying to use the %%scalene cell magic in a Jupyter Notebook running on GitHub Codespaces to profile a Numba-accelerated implementation of the Mandelbrot set. However, when I run the following ...
Ahmed Hossam's user avatar
3 votes
2 answers
163 views

I find this behavior quite counter-intuitive although I suppose there is a reason for it - numba automatically converts my numpy integer types directly into a python int: import numba as nb import ...
Raven's user avatar
  • 831
3 votes
1 answer
279 views

So I have this function: import numpy as np import numba as nb @nb.njit(cache=True, parallel=True, nogil=True) def triangle_half_UR_LL(size: int, swap: bool = False) -> tuple[np.ndarray, np.ndarray]...
Ξένη Γήινος's user avatar
1 vote
0 answers
130 views

Both Polars and Numba are fantastic libraries that complement each other pretty well. There are some limitations when using Numba-compiled functions in Polars: Arrow columns must be converted to ...
Olibarer's user avatar
  • 423
3 votes
1 answer
198 views

I am not sure title is well describing the problem but I will explain it step by step. I have a correlation matrix of genes (10k x 10k) I convert this correlation matrix to pairwise dataframe (upper ...
Yasir's user avatar
  • 1,120
0 votes
1 answer
175 views

I don't use Conda. I have downloaded and installed cuda_12.8.1_572.61_windows.exe from the official link. I have installed numba 0.61.0, numba-cuda 0.8.0, llvmlite 0.44.0, numpy 2.1.3, cuda-python 12....
Ξένη Γήινος's user avatar
4 votes
0 answers
96 views

Numba reimplements many NumPy functions in pure Python and uses LLVM to compile them, resulting in generally efficient performance. However, some Numba implementations show slower performance compared ...
Olibarer's user avatar
  • 423
0 votes
0 answers
90 views

I have a numba jitclass with an instance attribute that is a 1d-array of floats, initialized to be zeros (in the MRE as [0.,0.]). I have a jitted function that creates an instance of said class and ...
Rhombododeka's user avatar
0 votes
0 answers
97 views

I'm using numba to compile some expensive calcualtion for signifcant performance gains - this is wonderful! Recently I made a small change to the calcualtion to extract some additional values (...
jpmorr's user avatar
  • 676
0 votes
1 answer
66 views

I get a weird problem against numba with namedtuple & ListType. I defined 2 namedtuple as below. These 2 are similar. But one works well other one not work. import numba as nb from numba....
Joseph Cen's user avatar
0 votes
0 answers
71 views

I have a very basic group by function that I want to use in a Cython object but it's something like 400 times slower than a similar function in Python JITed by Numba This is my Cython function @cython....
jmatthew007's user avatar
-1 votes
1 answer
60 views

I am writing common code that supports both numba-jitting on CPU and numba.cuda-jitting on GPU. It all works well, except that deep inside the common code, I would like to use an intrinsic instruction ...
Hugues's user avatar
  • 3,196
0 votes
0 answers
34 views

I have a function that has a numba @njit wrapper around it to make it faster, I've set parallel=True to make it run faster. And now want to measure the time it takes, using time.process_time(), ...
Ninja Jim's user avatar
0 votes
0 answers
47 views

I am using numba with neat-python and numpy. Somehow I get the error: RuntimeError: Call parameter type does not match function signature! It was working well before. I have included relevant code ...
eeqesri's user avatar
  • 261
1 vote
1 answer
172 views

I am trying to make a fast and space efficient set implementation for 64 bit unsigned ints. I don't want to use set() as that converts everything into Python ints that use much more space than 8 ...
Simd's user avatar
  • 21.5k
0 votes
1 answer
302 views

I am trying to write a simulation that involves very large matrix multiplications and for loops. To speed up the process, I thought about using numba-scipy. After installing the package with conda, I ...
QFTheorist's user avatar
0 votes
1 answer
123 views

I have some code, generic numba. I'm attempting to compile it with setuptools, which I've done successfully before on this computer, in this environment, but lost my setup.py file. Code to compile ...
Matt Reed's user avatar
0 votes
1 answer
92 views

I'm trying to call a cfunction inside njitted function, but Numba does not have data_as() method for its array to cast double pointer. Could anyone help me figure out how to make it work? import ...
kesh's user avatar
  • 5,813
1 vote
0 answers
131 views

I am trying to get the basics of multiprocessing in python. I have a quite complex routine that takes a large array (c.a 1Gb) and a double as inputs and returns a double. The large array is not going ...
user415893's user avatar
1 vote
1 answer
230 views

In the following example, I have a simple CPU function: import numpy as np from numba import njit, cuda @njit def cpu_func(a, b, c, d): for i in range(len(a)): for l in range(d[i], 0, -1):...
slaw's user avatar
  • 6,989

1
2 3 4 5
49