You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e55a371
Browse filesBrowse the repository at this point in the historyBrowse files
test(cuda.bindings): reuse worker-thread contexts under pytest-run-parallel
The pytest-run-parallel plugin in the bindings conftest made each worker
thread create and destroy a CUDA context around every test. The driver
serializes context creation, so with four threads every test paid about
0.75 s. On free-threaded rows that run the bindings tests, the step took
36 to 39 minutes and the jobs hit the 60-minute limit.
Keep one context per running thread, but reuse it. A pool hands each
worker an idle context or creates one; the worker pushes it, runs the
test, synchronizes, and pops it, so the previous current context is
restored. A context that reports an error at the sync is destroyed, not
reused. The plugin destroys the pooled contexts at each module boundary,
so a context lives no longer than the module-scoped ctx fixture does in
a run without threads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments