Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix sdxl mlperf time bug #1580

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

huijuanzh
Copy link
Contributor

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Bug found when test with num_batches = throughput_warmup_steps.

test cmd:
python text_to_image_generation.py --model_name_or_path /host/mnt/ctrl/disk1/personal/cg/models/stable-diffusion-xl-base-1.0 --prompts "Sailing ship painting by Van Gogh" --num_imag es_per_prompt 10 --batch_size 4 --image_save_dir /tmp/stable_diffusion_xl_images --scheduler euler_discrete --use_habana --use_hpu_graphs --num_inference_steps 30 --height 1024 --width 1024 --gaudi_config Habana/stable-diffusion --bf16 --optimize

Speed metrics: {'generation_runtime': 247.3958, 'generation_samples_per_second': 0.049, 'generation_steps_per_second': 1.31}

python text_to_image_generation.py --model_name_or_path /host/mnt/ctrl/disk1/personal/cg/models/stable-diffusion-xl-base-1.0 --prompts "Sailing ship painting by Van Gogh" --num_imag es_per_prompt 16 --batch_size 4 --image_save_dir /tmp/stable_diffusion_xl_images --scheduler euler_discrete --use_habana --use_hpu_graphs --num_inference_steps 30 --height 1024 --width 1024 --gaudi_config Habana/stable-diffusion --bf16 --optimize

Speed metrics: {'generation_runtime': 261.2659, 'generation_samples_per_second': 0.258, 'generation_steps_per_second': 7.751}

G2D:

<style> </style>
resolution steps bs Throughput (image/s)
1024*1024 30 1 0.249
1024*1024 30 2 0.257
1024*1024 30 4 0.047

@huijuanzh huijuanzh requested a review from regisss as a code owner December 9, 2024 07:05
@huijuanzh
Copy link
Contributor Author

G2D update patch test:

<style> </style>
resolution steps num_images_per_prompt bs Throughput (image/s)
1024*1024 30 4 4 0.24
1024*1024 30 8 4 0.241
1024*1024 30 10 4 0.244
1024*1024 30 12 4 0.245
1024*1024 30 16 4 0.258
1024*1024 30 20 4 0.258
1024*1024 30 30 4 0.259

if t1 == t0 or use_warmup_inference_steps:
num_samples = num_batches * batch_size
num_steps = (num_inference_steps - throughput_warmup_steps) * num_batches * batch_size
num_samples = batch_size
Copy link
Collaborator

Choose a reason for hiding this comment

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

There could still be more than 1 batch no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we just calculate the latest batch time in use_warmup_inference_steps case(add and j == num_batches - 1 in line 841), so the num_samples is batch_size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants