Repository navigation
Prevent taking the GIL in ForAll - #4581
Conversation
|
The patch makes sense. Using We just need to run it through the our internal smoketest and we can accept it once it pass. |
@sklam great, let us know if we can help in any way. This is unfortunately a big blocker for us. |
|
Assuming nothing blows up in CI, it will be merged to master by the end of the day |
|
Passed CI, so marking this for merge this evening. |
|
Thanks @seibert ! |
|
The CUDA Occupancy API provides multiple versions of |
|
@harrism I just saw that the CUDA Occupancy API uses the runtime API, whereas Numba only uses the driver API (feel free to correct me if I'm wrong here), and that's probably why it uses |
|
In the interest of unblocking ucx-py, we'll merge this PR, but investigate @harrism's suggestion. |
|
@pentschev yep, I was referring to the driver API. The driver API has a version of |
This is the result of a long-running bug and discussion, detailed in rapidsai/ucx-py#187.
To summarize, calling
ForAllincurs in acuOccupancyMaxPotentialBlockSizethat takes two functions pointers, one being the CUDA kernel, and the other a function to calculate the require shared memory. The latter was a Python lambda before this PR, which caused thecuOccupancyMaxPotentialBlockSizeto ultimately end up trying to take the GIL. To prevent that from happening, we can pass the pointer to a pure C function instead.I have added no further tests since we could only reproduce this issue on very long and complex pipelines. Suggestions on how we could add tests for this are much appreciated.
Finally, I'm not sure if defining the C function via a
@cfuncdecorator is the preferred way, nor if this is the preferred place for the_b2d_functo live, please let me know if not.cc @quasiben @kkraus14 @shwina @mt-jones @Akshay-Venkatesh @mrocklin