Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Uni-Core
Commits
0da9683c
Unverified
Commit
0da9683c
authored
Jul 22, 2022
by
Guolin Ke
Committed by
GitHub
Jul 22, 2022
Browse files
use legacy pytorch fuser
parent
a6ed694a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
unicore/utils.py
unicore/utils.py
+5
-16
No files found.
unicore/utils.py
View file @
0da9683c
...
@@ -383,19 +383,8 @@ def fp32_to_bf16_sr(t, o):
...
@@ -383,19 +383,8 @@ def fp32_to_bf16_sr(t, o):
def
set_jit_fusion_options
():
def
set_jit_fusion_options
():
"""Set PyTorch JIT layer fusion options."""
"""Set PyTorch JIT layer fusion options."""
# flags required to enable jit fusion kernels
# flags required to enable jit fusion kernels
TORCH_MAJOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
0
])
# legacy pytorch fuser
TORCH_MINOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
1
])
torch
.
_C
.
_jit_set_profiling_mode
(
False
)
if
(
TORCH_MAJOR
>
1
)
or
(
TORCH_MAJOR
==
1
and
TORCH_MINOR
>=
10
):
torch
.
_C
.
_jit_set_profiling_executor
(
False
)
# nvfuser
torch
.
_C
.
_jit_override_can_fuse_on_cpu
(
True
)
torch
.
_C
.
_jit_set_profiling_executor
(
True
)
torch
.
_C
.
_jit_override_can_fuse_on_gpu
(
True
)
torch
.
_C
.
_jit_set_profiling_mode
(
True
)
torch
.
_C
.
_jit_override_can_fuse_on_cpu
(
False
)
torch
.
_C
.
_jit_override_can_fuse_on_gpu
(
False
)
torch
.
_C
.
_jit_set_texpr_fuser_enabled
(
False
)
torch
.
_C
.
_debug_set_autodiff_subgraph_inlining
(
False
)
else
:
# legacy pytorch fuser
torch
.
_C
.
_jit_set_profiling_mode
(
False
)
torch
.
_C
.
_jit_set_profiling_executor
(
False
)
torch
.
_C
.
_jit_override_can_fuse_on_cpu
(
True
)
torch
.
_C
.
_jit_override_can_fuse_on_gpu
(
True
)
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