diff --git a/msadaptor/torch/utils/data/_utils/worker.py b/msadaptor/torch/utils/data/_utils/worker.py index 0b04db233d032c49afdce51ba8b5d3183c39a1d2..e7a3f6326a66cf7b3877b65787ad7ed7a5c0fe27 100644 --- a/msadaptor/torch/utils/data/_utils/worker.py +++ b/msadaptor/torch/utils/data/_utils/worker.py @@ -15,6 +15,7 @@ import torch from torch._utils import ExceptionWrapper import torch.configs +from mindspore._c_expression import disable_multi_thread from . import HAS_NUMPY, IS_WINDOWS, MP_STATUS_CHECK_INTERVAL, signal_handling @@ -246,6 +247,7 @@ def _worker_loop( # See NOTE [ Data Loader Multiprocessing Shutdown Logic ] for details on the # logic of this function. torch.configs.set_pyboost(use_pyboost) + disable_multi_thread() try: # Initialize C side signal handlers for SIGBUS and SIGSEGV. Python signal # module's handlers are executed after Python returns from C low-level