From 9e9679c022790d74a7588e844a7598e3590aea7e Mon Sep 17 00:00:00 2001 From: Huazhong Ji Date: Thu, 6 Jun 2024 19:41:31 +0800 Subject: [PATCH] fix: `str` should be used not `int` when setting env variables (#31272) --- src/transformers/trainer_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformers/trainer_utils.py b/src/transformers/trainer_utils.py index a52560a77cf339..5f690065884034 100644 --- a/src/transformers/trainer_utils.py +++ b/src/transformers/trainer_utils.py @@ -72,8 +72,8 @@ def enable_full_determinism(seed: int, warn_only: bool = False): os.environ["CUDA_LAUNCH_BLOCKING"] = "1" os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":16:8" # The environment variable required to enable deterministic mode on Ascend NPUs. - os.environ["ASCEND_LAUNCH_BLOCKING"] = 1 - os.environ["HCCL_DETERMINISTIC"] = 1 + os.environ["ASCEND_LAUNCH_BLOCKING"] = "1" + os.environ["HCCL_DETERMINISTIC"] = "1" torch.use_deterministic_algorithms(True, warn_only=warn_only) # Enable CUDNN deterministic mode