Skip to content

Commit

Permalink
Add Torch CUDA sync to fix timing code in cli.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Movva committed Sep 11, 2024
1 parent d013dc4 commit fe0992e
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

0 comments on commit fe0992e

Please sign in to comment.