Uh oh!
There was an error while loading. Please reload this page.
Make populating the internal symbol table thread-safe - #835
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
leofang
commented
Aug 13, 2025
/ok to test 3fe6a3c |
This comment has been minimized.
This comment has been minimized.
kkraus14
commented
Aug 13, 2025
/ok to test 67e543c |
| cdef int err, driver_ver | ||
| with gil, __symbol_lock: | ||
| # Load driver to check version | ||
| handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) |
There was a problem hiding this comment.
Unrelated to this PR, but... this handle is used to get the driver version, which is fed into the load_library call which doesn't use the driver version. This is likely a codegen issue, but we should probably just remove this?
There was a problem hiding this comment.
Either way, wanted to call it out here but we can defer it to a future PR
kkraus14
commented
Aug 13, 2025
/ok to test 095999a |
kkraus14
commented
Aug 13, 2025
Stopped CI because they all deadlocked at the start of testing. Likely caused a lock ordering issue here that we need to triage. |
…rocAddress in the init function...
kkraus14
commented
Aug 14, 2025
/ok to test |
@kkraus14, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
kkraus14
commented
Aug 14, 2025
/ok to test 47c1c52 |
Uh oh!
There was an error while loading. Please reload this page.
kkraus14
commented
Aug 14, 2025
/ok to test 5f4125e |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
leofang
commented
Aug 15, 2025
/ok to test 8e79272 |
| if __cuPythonInit: | ||
| return 0 |
There was a problem hiding this comment.
With this outside of the lock if you have a bunch of threads trying to run this initially at the same time, you can end up in the situation where they all don't hit this early exit and all wait for the symbol lock and the reinitialize all of the symbols. I had done a quick and dirty local benchmark with a single thread acquiring a lock and doing nothing to understand the overhead in the early exit case and it was ~50ns.
There was a problem hiding this comment.
Yeah I thought about this too. Good to know it's only ~50 ns. We should fix the codegen so that we check if symbol is null to avoid re-initialization, but it can be done later.
Uh oh!
There was an error while loading. Please reload this page.
leofang
commented
Aug 15, 2025
/ok to test 1672f40 |
leofang
commented
Aug 18, 2025
Merging as per #836 (comment). |
|
Description
TODO
[ ] runtimeChecklist