Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
9cef07da
Unverified
Commit
9cef07da
authored
Dec 17, 2023
by
Sayak Paul
Committed by
GitHub
Dec 17, 2023
Browse files
[Benchmarks] fix: lcm benchmarking reporting (#6198)
* fix: lcm benchmarking reporting * fix generate_csv_dict call.
parent
2d94c783
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
benchmarks/base_classes.py
benchmarks/base_classes.py
+19
-0
No files found.
benchmarks/base_classes.py
View file @
9cef07da
...
...
@@ -162,6 +162,25 @@ class LCMLoRATextToImageBenchmark(TextToImageBenchmark):
guidance_scale
=
1.0
,
)
def
benchmark
(
self
,
args
):
flush
()
print
(
f
"[INFO]
{
self
.
pipe
.
__class__
.
__name__
}
: Running benchmark with:
{
vars
(
args
)
}
\n
"
)
time
=
benchmark_fn
(
self
.
run_inference
,
self
.
pipe
,
args
)
# in seconds.
memory
=
bytes_to_giga_bytes
(
torch
.
cuda
.
max_memory_allocated
())
# in GBs.
benchmark_info
=
BenchmarkInfo
(
time
=
time
,
memory
=
memory
)
pipeline_class_name
=
str
(
self
.
pipe
.
__class__
.
__name__
)
flush
()
csv_dict
=
generate_csv_dict
(
pipeline_cls
=
pipeline_class_name
,
ckpt
=
self
.
lora_id
,
args
=
args
,
benchmark_info
=
benchmark_info
)
filepath
=
self
.
get_result_filepath
(
args
)
write_to_csv
(
filepath
,
csv_dict
)
print
(
f
"Logs written to:
{
filepath
}
"
)
flush
()
class
ImageToImageBenchmark
(
TextToImageBenchmark
):
pipeline_class
=
AutoPipelineForImage2Image
...
...
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