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
ColossalAI
Commits
fbd2a9e0
Commit
fbd2a9e0
authored
Mar 30, 2023
by
YuliangLiu0306
Committed by
アマデウス
Mar 30, 2023
Browse files
[hotfix] meta_tensor_compatibility_with_torch2
parent
15a74da7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
colossalai/fx/_compatibility.py
colossalai/fx/_compatibility.py
+0
-2
colossalai/fx/profiler/opcount.py
colossalai/fx/profiler/opcount.py
+2
-1
No files found.
colossalai/fx/_compatibility.py
View file @
fbd2a9e0
...
@@ -14,9 +14,7 @@ elif TORCH_MAJOR == 1 and TORCH_MINOR == 13:
...
@@ -14,9 +14,7 @@ elif TORCH_MAJOR == 1 and TORCH_MINOR == 13:
from
.
import
_meta_regist_13
from
.
import
_meta_regist_13
META_COMPATIBILITY
=
True
META_COMPATIBILITY
=
True
elif
TORCH_MAJOR
==
2
:
elif
TORCH_MAJOR
==
2
:
from
.
import
_meta_regist_13
META_COMPATIBILITY
=
True
META_COMPATIBILITY
=
True
raise
UserWarning
(
"Colossalai is not tested with torch2.0 yet!!!"
)
def
compatibility
(
is_backward_compatible
:
bool
=
False
)
->
Callable
:
def
compatibility
(
is_backward_compatible
:
bool
=
False
)
->
Callable
:
...
...
colossalai/fx/profiler/opcount.py
View file @
fbd2a9e0
...
@@ -223,7 +223,8 @@ def zero_flop_jit(*args):
...
@@ -223,7 +223,8 @@ def zero_flop_jit(*args):
return
0
return
0
if
version
.
parse
(
torch
.
__version__
)
>=
version
.
parse
(
'1.12.0'
):
if
version
.
parse
(
torch
.
__version__
)
>=
version
.
parse
(
'1.12.0'
)
and
version
.
parse
(
torch
.
__version__
)
<
version
.
parse
(
'2.0.0'
):
flop_mapping
=
{
flop_mapping
=
{
# gemm, gemv and dot
# gemm, gemv and dot
aten
.
mm
.
default
:
matmul_flop_jit
,
aten
.
mm
.
default
:
matmul_flop_jit
,
...
...
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