-
Notifications
You must be signed in to change notification settings - Fork 193
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
Implementation of Batching, Enabling HPU Graphs and FP8 quantization for SD3 Pipeline #1345
base: main
Are you sure you want to change the base?
Implementation of Batching, Enabling HPU Graphs and FP8 quantization for SD3 Pipeline #1345
Conversation
Considering number of samples as 1 ( whole batch ) to have perf measure consistent with industry standard for easier comparison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see inline comments and requested changes. Also, make sure there is at least 1 CI test for SD3 with batching added to test_diffusers
optimum/habana/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please add a test for batch sizes to tests /test_diffusers.py
Added the tests for Batch Size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. There are some extra spaces in sd3 pipeline file you should run make style
to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add example of running FP8 mode in README
examples/stable-diffusion/quantization/stable-diffusion-3/measure_config.json
Outdated
Show resolved
Hide resolved
examples/stable-diffusion/quantization/stable-diffusion-3/quantize_config.json
Outdated
Show resolved
Hide resolved
Added the example |
Fixed |
@dsocek Please provide Feedback on the changes |
@libinta Request to review the PR and push for merging |
@deepak-gowda-narayana , |
Result Summary of fast_tests.sh python -m pytest tests/test_gaudi_configuration.py tests/test_trainer_distributed.py tests/test_trainer.py tests/test_trainer_seq2seq.py tests/test_gaudi_configuration.py .. [ 2%] ================================================================================================================== warnings summary =================================================================================================================== ../../usr/local/lib/python3.10/dist-packages/transformers/deepspeed.py:24 tests/test_trainer.py::GaudiTrainerIntegrationPrerunTest::test_cosine_with_min_lr_scheduler tests/test_trainer.py: 12 warnings tests/test_trainer.py: 12 warnings tests/test_trainer.py::GaudiTrainerIntegrationTest::test_load_best_model_from_safetensors tests/test_trainer.py::GaudiTrainerIntegrationTest::test_load_best_model_with_save tests/test_trainer.py::GaudiTrainerIntegrationTest::test_multiple_peft_adapters tests/test_trainer.py::GaudiTrainerIntegrationTest::test_multiple_peft_adapters tests/test_trainer.py::GaudiTrainerIntegrationTest::test_resume_training_with_safe_checkpoint tests/test_trainer.py::GaudiTrainerOptimizerChoiceTest::test_optim_supported_0_adamw_hf tests/test_trainer_seq2seq.py::GaudiSeq2seqTrainerTester::test_bad_generation_config_fail_early tests/test_trainer_seq2seq.py::GaudiSeq2seqTrainerTester::test_finetune_t5 tests/test_trainer_seq2seq.py::GaudiSeq2seqTrainerTester::test_finetune_t5 -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html Result Summary of fast_tests_diffusers.sh python -m pytest tests/test_diffusers.py tests/test_diffusers.py .......sssss..........s.......s........................s.ss.sssssssssssss.............sss.......s....s.....ss.s.ssssss......s...s......s.sss........s..s.s....s [100%] ======================================================================================================= warnings summary ======================================================================================================= ../../usr/local/lib/python3.10/dist-packages/diffusers/models/vq_model.py:20 ../../usr/local/lib/python3.10/dist-packages/diffusers/models/vq_model.py:25 tests/test_diffusers.py: 50 warnings tests/test_diffusers.py::GaudiPipelineUtilsTester::test_save_pretrained
tests/test_diffusers.py: 10 warnings tests/test_diffusers.py: 79 warnings tests/test_diffusers.py: 79 warnings tests/test_diffusers.py: 13 warnings tests/test_diffusers.py::GaudiStableDiffusionControlNetPipelineTester::test_stable_diffusion_controlnet_batch_sizes tests/test_diffusers.py::GaudiStableDiffusionControlNetPipelineTester::test_stable_diffusion_controlnet_batch_sizes tests/test_diffusers.py::GaudiStableDiffusionMultiControlNetPipelineTester::test_stable_diffusion_multicontrolnet_batch_sizes tests/test_diffusers.py::GaudiStableDiffusionDepth2ImgPipelineTester::test_depth2img_pipeline_batch tests/test_diffusers.py::GaudiStableDiffusionDepth2ImgPipelineTester::test_depth2img_pipeline_batch tests/test_diffusers.py::GaudiStableDiffusionDepth2ImgPipelineTester::test_depth2img_pipeline_batch tests/test_diffusers.py: 14 warnings tests/test_diffusers.py::StableDiffusionInpaintPipelineFastTests::test_karras_schedulers_shape tests/test_diffusers.py::StableDiffusionInpaintPipelineFastTests::test_karras_schedulers_shape tests/test_diffusers.py::StableDiffusionXLInpaintPipelineFastTests::test_stable_diffusion_xl_inpaint_2_images -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html Result Summary of slow_tests_diffusers.sh tests/test_diffusers.py:872: AssertionError ../../usr/local/lib/python3.10/dist-packages/diffusers/models/vq_model.py:20 ../../usr/local/lib/python3.10/dist-packages/diffusers/models/vq_model.py:25 -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html |
Added support for batch wise implementation and enabled HPU Graph integration, FP8 quantization for sd3 pipeline to optimize the pipeline performance on Gaudi 2.
What does this PR do?
Fixes # (issue)
Before submitting