Skip to content

Commit aff2d9d

Browse files
committed
remove profile
1 parent aa8ea5d commit aff2d9d

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

tools/perf/Flux/flux_perf.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,6 @@
99
from flux_demo import compile_model
1010

1111

12-
def profile(pipe, prompt, inference_step, batch_size=1):
13-
print(f"Running torch profiler with {inference_step=} {batch_size=}")
14-
with torch.profiler.profile(
15-
activities=[torch.profiler.ProfilerActivity.CUDA],
16-
record_shapes=True,
17-
profile_memory=True,
18-
with_stack=True,
19-
) as prof:
20-
with torch.profiler.record_function("model_inference"):
21-
pipe(
22-
prompt,
23-
output_type="pil",
24-
num_inference_steps=inference_step,
25-
num_images_per_prompt=batch_size,
26-
).images
27-
print(prof.key_averages().table(sort_by="cuda_time_total", row_limit=100))
28-
29-
3012
def benchmark(pipe, prompt, inference_step, batch_size=1, iterations=1):
3113
print(f"Running warmup with {batch_size=} {inference_step=} iterations=10")
3214
# warmup
@@ -67,7 +49,6 @@ def main(args):
6749
pipe, backbone, trt_gm = compile_model(args)
6850

6951
benchmark(pipe, ["Test"], 20, batch_size=args.max_batch_size, iterations=3)
70-
# profile(pipe, ["enchanted winter forest, soft diffuse light on a snow-filled day, serene nature scene, the forest is illuminated by the snow"], 20, batch_size=args.max_batch_size)
7152

7253

7354
if __name__ == "__main__":

0 commit comments

Comments
 (0)