Sadly, numba.cuda no longer works and numba-cuda has gone into maintenance mode and is being replaced by numa-cuda-mlir:
numba/numba#10753
nzxyin/sdtw-cuda-torch#2
The solution would be to do:
try:
from numba_cuda_mlir import cuda
except ModuleNotFoundError:
from numba import cuda
To Do:
Extra Notes
When you runtests.sh gpu and encounter:
TypeError: Signature mismatch: 2 argument types given, but function takes 1 arguments
This is because numba.cuda introduced a bug that does not support *args as inputs to the min and max builtin functions. To resolve this, you must (minimally) use
However, this is insufficient on its own and you may then encounter:
AttributeError: module 'numpy' has no attribute 'row_stack'
This is because row_stack was deprecated in numpy v2.0 and fully removed in v2.5! Thus, the only way to overcome this is to use an older version of numpy with the no longer maintained numba-cuda:
numba-cuda = "*"
numpy = "<2.5"
and then this combination should allow the tests to pass! However, the real question is whether numba-cuda-mlir allows us to just do:
Sadly,
numba.cudano longer works andnumba-cudahas gone into maintenance mode and is being replaced by numa-cuda-mlir:numba/numba#10753
nzxyin/sdtw-cuda-torch#2
The solution would be to do:
To Do:
numba-cuda-mliron specific platformsconda.shnumba-cuda-mlirtorequirements.txtgpu_mpdist,gpu_stimp,gpu_ostinato) and replacecudaimportExtra Notes
When you run
tests.sh gpuand encounter:This is because
numba.cudaintroduced a bug that does not support*argsas inputs to theminandmaxbuiltin functions. To resolve this, you must (minimally) useHowever, this is insufficient on its own and you may then encounter:
This is because
row_stackwas deprecated innumpyv2.0 and fully removed in v2.5! Thus, the only way to overcome this is to use an older version ofnumpywith the no longer maintainednumba-cuda:and then this combination should allow the tests to pass! However, the real question is whether
numba-cuda-mlirallows us to just do: