New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add or document signature syntax for zero dimensional arrays #3838
Comments
Thanks for the suggestion. Some background: Essentially, the string syntax works by just evaluating the string using Python's All this said, some other syntax could be overloaded e.g. Lines 175 to 204 in ccb5705
|
Hi.
Sorry if I'm not supposed to write to you but we have corresponded on a couple of bugs I had submitted. I already asked a couple cuda experts like Alex Ford. Unsure of where to post Numba Cuda Questions in general (tried stackoverflow for this one already).
What would cause a Numba Cuda kernel to do nothing but not return an error?
Problem:
My code runs fine with small threadblocks (16x8 or less) but Above a certain number of threads my call to the cuda kernel leaves the output array unmodified.
Expected result:
If it runs on a small block then it either runs on the large block or I get an error.
Actual result:
No error. But output array is unmodified (stays zero).
Regression:
1. Doesn't depend on block shape or special block sizes. It's just block bigger than a certain size fail
2. When it runs the output is mathematically correct for a very complex calculation regardless of thread block
3. THe numba reported register count is less than 64 (usual 45 to 56 registers). Since this is an RTX 2070 the SM should support 64K registers and thus 1024 threads with a register count under 64.
4. If I do increase the register count intentionally above that limit I can cause an error.
5. if I break the code up into pieces each of them runs fine on large blocks. Suggesting something like a register issue but as noted no evidence of this.
6. I'm running it in Jupyter notebooks. It's very hard to run it outside of the notebook because of all the initializations. I may need to do this. But since I'm in the dark about what could do this without causing an error thats a desperation move.
|
@cems2 I would suggest opening a new issue, ideally with sample code demonstrating the problem, and someone will take a look (to get a faster response, also include a description of the hardware on which it is running). Sounds like it might be resource contention/exhaustion. You'll note in the issue tracker that there's a |
Problem Being addressed.
Numba has a text syntax for function signatures such as
'f8' or 'float32[:,:]'
However there is no simple text syntax for other arrays such as zero dimensional arrays
You can do this using a poorly documented alternative syntax of using explicit types in the signature rather than the simplified text string convention. For example
@nb.njit(nb.types.Array(nb.int64, 0, "C")())
Feature request
Add syntax for at least the Zero dimensional case since this is actually pretty common when using cuda. (because you can store scalars on the GPU if you make them zero dimensional arrays).
Here's a possible syntax that might be worth considering.
'float32[]' # empty brackets without any colons would imply zero dimensions
A final matter to consider would be if one wants to also worry about fortran versus C order arrays. My vote would be not to worry about that since it would complicate the syntax. But if you chose to do so then a possible ansatz would be to replace the ":" colon sigils with the letter F like this:
'float32[F,F]'
# where F is the signal for a fortran order 2 D arrayNote that zero and 1D arrays are identical in C and F
The text was updated successfully, but these errors were encountered: