Skip to content

Commit

Permalink
Add Torch CUDA sync to fix timing code in cli.py (#147)
Browse files Browse the repository at this point in the history
Co-authored-by: Neil Movva <[email protected]>
  • Loading branch information
neilmovva and Neil Movva authored Sep 13, 2024
1 parent d013dc4 commit 87f6fff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/flux/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ def main(
x = unpack(x.float(), opts.height, opts.width)
with torch.autocast(device_type=torch_device.type, dtype=torch.bfloat16):
x = ae.decode(x)

if torch.cuda.is_available():
torch.cuda.synchronize()
t1 = time.perf_counter()

fn = output_name.format(idx=idx)
Expand Down

1 comment on commit 87f6fff

@mohabell1976
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text design :"You're Simply the Best, Auntie! Happy Birthday!" "Elegant yet playful text with a cartoon candle shaped like a lipstick. The design is chic and modern with fun confetti and a small, smiling auntie figure wearing sunglasses. Use bright pinks and gold tones."

Please sign in to comment.