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
d8420f81
"vscode:/vscode.git/clone" did not exist on "51472e756a1e43cc4e6d36597920f382af673d71"
Unverified
Commit
d8420f81
authored
Oct 05, 2022
by
Boyuan Yao
Committed by
GitHub
Oct 05, 2022
Browse files
[hotfix] fix wrong type name in profiler (#1678)
parent
132b4306
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
colossalai/fx/profiler/profiler.py
colossalai/fx/profiler/profiler.py
+2
-1
No files found.
colossalai/fx/profiler/profiler.py
View file @
d8420f81
from
functools
import
partial
from
typing
import
Callable
,
Any
,
Dict
,
Tuple
import
torch
from
torch.nn.parameter
import
Parameter
from
torch.fx
import
Graph
,
Node
from
torch.fx.node
import
Argument
,
Target
from
torch.utils._pytree
import
tree_map
...
...
@@ -298,7 +299,7 @@ def profile_function(target: 'Target', device: str = 'meta') -> Callable:
param_size
=
0
def
get_param_size
(
x
):
if
isinstance
(
x
,
torch
.
nn
.
p
arameter
):
if
isinstance
(
x
,
P
arameter
):
param_size
+=
activation_size
(
x
)
tree_map
(
get_param_size
,
args
)
...
...
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