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
TransformerEngine
Commits
b957aa47
Unverified
Commit
b957aa47
authored
Jan 24, 2024
by
Przemyslaw Tredak
Committed by
GitHub
Jan 24, 2024
Browse files
Fix compatibility with pyTorch 2.0 (#627)
Signed-off-by:
Przemek Tredak
<
ptredak@nvidia.com
>
parent
bea70f2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
transformer_engine/pytorch/jit.py
transformer_engine/pytorch/jit.py
+6
-1
No files found.
transformer_engine/pytorch/jit.py
View file @
b957aa47
...
@@ -22,7 +22,12 @@ if torch.__version__ >= "2.2" and bool(int(os.getenv("NVTE_TORCH_COMPILE", "1"))
...
@@ -22,7 +22,12 @@ if torch.__version__ >= "2.2" and bool(int(os.getenv("NVTE_TORCH_COMPILE", "1"))
no_torch_dynamo
=
lambda
recursive
=
True
:
lambda
func
:
func
no_torch_dynamo
=
lambda
recursive
=
True
:
lambda
func
:
func
if
torch
.
__version__
>=
"2"
:
if
torch
.
__version__
>=
"2"
:
import
torch._dynamo
import
torch._dynamo
no_torch_dynamo
=
lambda
recursive
=
True
:
lambda
f
:
torch
.
_dynamo
.
disable
(
f
,
recursive
=
recursive
)
if
torch
.
__version__
>=
"2.1"
:
no_torch_dynamo
=
lambda
recursive
=
True
:
lambda
f
:
\
torch
.
_dynamo
.
disable
(
f
,
recursive
=
recursive
)
else
:
# no "recursive" option in pyTorch 2.0 - it acts as if recursive was True
no_torch_dynamo
=
lambda
recursive
=
True
:
torch
.
_dynamo
.
disable
def
set_jit_fusion_options
()
->
None
:
def
set_jit_fusion_options
()
->
None
:
...
...
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