Repository navigation
Fix Windows ROCm hang on Translator destruction and DLL loading, build with ROCm 10.0 - #2106
Conversation
|
Could we also clean up the calling threadβs pool after model loading, including on exceptions? Weight conversion can invoke A regression test that loads a model requiring weight conversion on temporary threads and checks that the thread count returns to baseline would cover this path. |
a191c51 to
b299796
Compare
|
Good catch, thanks. The calling thread's pool also gets recreated after Added The test pins |
b299796 to
a63554a
Compare
a63554a to
f6fa443
Compare
|
Thanks! |
Fixes #2101.
On Windows ROCm wheels, OpenMP is not detected by CMake, so
parallel_forfalls back to astatic thread_localBS::thread_pool. When the replica worker exits, the pool is destroyed under the loader lock while its threads also need that lock, causingTranslatordestruction to hang after multi-threaded CPU work. The fix mirrors #2076: the pool is heap-allocated on Windows and freed fromdestroy_context()inReplicaWorker::finalize().test_shutdown_does_not_deadlocknow passes on ROCm.Also fixes ROCm DLL discovery.
__init__.pynow supports_rocm_sdk_libraries,_rocm_sdk_libraries_gfx*, and the older_rocm_sdk_libraries_custompackage.HIP_PATH\binis used as a fallback only when no ROCm pip package is installed.The Windows ROCm wheel is now built against ROCm 10.0.0 instead of 7.2, avoiding a ROCm 7.2 runtime exit hang.
Tested on Windows 11 with an RX 9060 XT (gfx1200) on ROCm 7.2, 7.14, and 10.0.
Translatordestruction now returns in under 20 ms instead of hanging, GPU translation works, and the Python test suite passes aside from tests requiring unavailable data or CUDA-enabled torch.