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
nni
Commits
b2225436
"...dequantize_gemm/example_dequant_gemm_mxfp4_hopper.py" did not exist on "cde1886f2bee29c4a4fada0d1514ecb076409e2a"
Unverified
Commit
b2225436
authored
Jun 20, 2021
by
Bill Wu
Committed by
GitHub
Jun 21, 2021
Browse files
flops counter formatting fix (#3837)
parent
91ef554d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
nni/compression/pytorch/utils/counter.py
nni/compression/pytorch/utils/counter.py
+3
-2
No files found.
nni/compression/pytorch/utils/counter.py
View file @
b2225436
...
...
@@ -313,12 +313,13 @@ class ModelProfiler:
table
.
field_names
=
headers
for
i
,
result
in
enumerate
(
self
.
results
):
flops_count
=
int
(
result
[
'flops'
].
item
())
if
isinstance
(
result
[
'flops'
],
torch
.
Tensor
)
else
int
(
result
[
'flops'
])
row_values
=
[
i
,
result
[
'name'
],
result
[
'module_type'
],
str
(
result
[
'weight_shape'
]),
result
[
'flops'
]
,
flops_count
,
result
[
'params'
],
]
name_counter
[
result
[
'name'
]]
+=
1
...
...
@@ -408,4 +409,4 @@ def count_flops_params(model, x, custom_ops=None, verbose=True, mode='default'):
print
(
f
'FLOPs total:
{
profiler
.
sum_flops
()
}
'
)
print
(
f
'#Params total:
{
profiler
.
sum_params
()
}
'
)
return
profiler
.
sum_flops
(),
profiler
.
sum_params
(),
profiler
.
results
\ No newline at end of file
return
profiler
.
sum_flops
(),
profiler
.
sum_params
(),
profiler
.
results
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