Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,11 @@ def __call__(
hb_profiler.start()

# 8. Denoising loop
throughput_warmup_steps = kwargs.get("throughput_warmup_steps", 3)
Comment thread
regisss marked this conversation as resolved.
for j in self.progress_bar(range(num_batches)):
# The throughput is calculated from the 3rd iteration
# because compilation occurs in the first two iterations
if j == kwargs.get("throughput_warmup_steps", 3):
if j == throughput_warmup_steps:
t1 = time.time()

latents_batch = latents_batches[0]
Expand Down Expand Up @@ -615,7 +616,9 @@ def __call__(
speed_measures = speed_metrics(
split=speed_metrics_prefix,
start_time=t0,
num_samples=num_batches * batch_size if t1 == t0 else (num_batches - 2) * batch_size,
num_samples=num_batches * batch_size
if t1 == t0
else (num_batches - throughput_warmup_steps) * batch_size,
num_steps=num_batches,
start_time_after_warmup=t1,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,11 @@ def __call__(
self._num_timesteps = len(timesteps)

# 8. Denoising loop
throughput_warmup_steps = kwargs.get("throughput_warmup_steps", 3)
for j in self.progress_bar(range(num_batches)):
# The throughput is calculated from the 3rd iteration
# because compilation occurs in the first two iterations
if j == kwargs.get("throughput_warmup_steps", 3):
if j == throughput_warmup_steps:
t1 = time.time()

latents_batch = latents_batches[0]
Expand Down Expand Up @@ -560,7 +561,9 @@ def __call__(
speed_measures = speed_metrics(
split=speed_metrics_prefix,
start_time=t0,
num_samples=num_batches * batch_size if t1 == t0 else (num_batches - 2) * batch_size,
num_samples=num_batches * batch_size
if t1 == t0
else (num_batches - throughput_warmup_steps) * batch_size,
num_steps=num_batches,
start_time_after_warmup=t1,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,11 @@ def __call__(
t1 = t0

# 8. Denoising loop
throughput_warmup_steps = kwargs.get("throughput_warmup_steps", 3)
for j in self.progress_bar(range(num_batches)):
# The throughput is calculated from the 3rd iteration
# because compilation occurs in the first two iterations
if j == kwargs.get("throughput_warmup_steps", 3):
if j == throughput_warmup_steps:
t1 = time.time()

latents_batch = latents_batches[0]
Expand Down Expand Up @@ -401,7 +402,9 @@ def __call__(
speed_measures = speed_metrics(
split=speed_metrics_prefix,
start_time=t0,
num_samples=num_batches * batch_size if t1 == t0 else (num_batches - 2) * batch_size,
num_samples=num_batches * batch_size
if t1 == t0
else (num_batches - throughput_warmup_steps) * batch_size,
num_steps=num_batches,
start_time_after_warmup=t1,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,11 @@ def __call__(
t1 = t0

# 10. Denoising loop
throughput_warmup_steps = kwargs.get("throughput_warmup_steps", 3)
for j in self.progress_bar(range(num_batches)):
# The throughput is calculated from the 3rd iteration
# because compilation occurs in the first two iterations
if j == kwargs.get("throughput_warmup_steps", 3):
if j == throughput_warmup_steps:
t1 = time.time()

latents_batch = latents_batches[0]
Expand Down Expand Up @@ -522,7 +523,9 @@ def __call__(
speed_measures = speed_metrics(
split=speed_metrics_prefix,
start_time=t0,
num_samples=num_batches * batch_size if t1 == t0 else (num_batches - 2) * batch_size,
num_samples=num_batches * batch_size
if t1 == t0
else (num_batches - throughput_warmup_steps) * batch_size,
num_steps=num_batches,
start_time_after_warmup=t1,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,11 @@ def __call__(
self._num_timesteps = len(timesteps)

# 8.3 Denoising loop
throughput_warmup_steps = kwargs.get("throughput_warmup_steps", 3)
for j in self.progress_bar(range(num_batches)):
# The throughput is calculated from the 3rd iteration
# because compilation occurs in the first two iterations
if j == kwargs.get("throughput_warmup_steps", 3):
if j == throughput_warmup_steps:
t1 = time.time()

latents_batch = latents_batches[0]
Expand Down Expand Up @@ -778,7 +779,9 @@ def __call__(
speed_measures = speed_metrics(
split=speed_metrics_prefix,
start_time=t0,
num_samples=num_batches * batch_size if t1 == t0 else (num_batches - 2) * batch_size,
num_samples=num_batches * batch_size
if t1 == t0
else (num_batches - throughput_warmup_steps) * batch_size,
num_steps=num_batches,
start_time_after_warmup=t1,
)
Expand Down