[Bugfix] [Easy] Fixed a bug in the multiprocessing GPU executor. (#6770)
This commit is contained in:
parent
062a1d0fab
commit
084a01fd35
@ -1,6 +1,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
|
import threading
|
||||||
import weakref
|
import weakref
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from typing import Any, List, Optional
|
from typing import Any, List, Optional
|
||||||
@ -115,6 +116,7 @@ class MultiprocessingGPUExecutor(DistributedGPUExecutor):
|
|||||||
if executor := ref():
|
if executor := ref():
|
||||||
executor.shutdown()
|
executor.shutdown()
|
||||||
|
|
||||||
|
if threading.current_thread() is threading.main_thread():
|
||||||
signal.signal(signal.SIGINT, shutdown)
|
signal.signal(signal.SIGINT, shutdown)
|
||||||
signal.signal(signal.SIGTERM, shutdown)
|
signal.signal(signal.SIGTERM, shutdown)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user