Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
9e9679c0
Unverified
Commit
9e9679c0
authored
Jun 06, 2024
by
Huazhong Ji
Committed by
GitHub
Jun 06, 2024
Browse files
fix: `str` should be used not `int` when setting env variables (#31272)
parent
9ef93fcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/trainer_utils.py
src/transformers/trainer_utils.py
+2
-2
No files found.
src/transformers/trainer_utils.py
View file @
9e9679c0
...
@@ -72,8 +72,8 @@ def enable_full_determinism(seed: int, warn_only: bool = False):
...
@@ -72,8 +72,8 @@ def enable_full_determinism(seed: int, warn_only: bool = False):
os
.
environ
[
"CUDA_LAUNCH_BLOCKING"
]
=
"1"
os
.
environ
[
"CUDA_LAUNCH_BLOCKING"
]
=
"1"
os
.
environ
[
"CUBLAS_WORKSPACE_CONFIG"
]
=
":16:8"
os
.
environ
[
"CUBLAS_WORKSPACE_CONFIG"
]
=
":16:8"
# The environment variable required to enable deterministic mode on Ascend NPUs.
# The environment variable required to enable deterministic mode on Ascend NPUs.
os
.
environ
[
"ASCEND_LAUNCH_BLOCKING"
]
=
1
os
.
environ
[
"ASCEND_LAUNCH_BLOCKING"
]
=
"1"
os
.
environ
[
"HCCL_DETERMINISTIC"
]
=
1
os
.
environ
[
"HCCL_DETERMINISTIC"
]
=
"1"
torch
.
use_deterministic_algorithms
(
True
,
warn_only
=
warn_only
)
torch
.
use_deterministic_algorithms
(
True
,
warn_only
=
warn_only
)
# Enable CUDNN deterministic mode
# Enable CUDNN deterministic mode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment