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

[Tests] add test suite for SD3 DreamBooth #8650

Merged
merged 12 commits into from
Jul 2, 2024
Merged

Conversation

sayakpaul
Copy link
Member

What does this PR do?

SD3 training will be crucial in the coming days and we would want to ensure robustness for our canonical scripts. So, this PR adds test suites for the LoRA and non-LoRA DreamBooth scripts.

@sayakpaul sayakpaul changed the title [Tests] add a test suite for SD3 DreamBooth [Tests] add test suite for SD3 DreamBooth Jun 20, 2024
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@sayakpaul sayakpaul marked this pull request as ready for review June 20, 2024 12:16
@sayakpaul sayakpaul requested review from asomoza and yiyixuxu June 20, 2024 12:17
@sayakpaul
Copy link
Member Author

Will add more tests for prior preservation too in a separate PR once I fix it (reference: #8589).

@sayakpaul
Copy link
Member Author

@yiyixuxu @asomoza a gentle ping here.

@asomoza
Copy link
Member

asomoza commented Jun 29, 2024

Really great idea!. Actually it helps a lot. I wanted to test it and all the tests fails for me and I know why, so I'll open a PR to fix it.

@sayakpaul
Copy link
Member Author

@asomoza which tests are you referring to?

@asomoza
Copy link
Member

asomoza commented Jun 30, 2024

Tested the lora ones:

pytest examples/dreambooth/test_dreambooth_lora_sd3.py 
============================================================ test session starts =============================================================
platform linux -- Python 3.12.3, pytest-8.2.2, pluggy-1.5.0
configfile: pyproject.toml
plugins: requests-mock-1.10.0, xdist-3.6.1, timeout-2.3.1
collected 3 items                                                                                                                            

examples/dreambooth/test_dreambooth_lora_sd3.py FFF                                                                                    [100%]

========================================================== short test summary info ===========================================================
FAILED examples/dreambooth/test_dreambooth_lora_sd3.py::DreamBoothLoRASD3::test_dreambooth_lora_sd3 - test_examples_utils.SubprocessCallException: Command `accelerate launch --config_file /tmp/tmp2yatc1ok/default_config.yml examples/dreamb...
FAILED examples/dreambooth/test_dreambooth_lora_sd3.py::DreamBoothLoRASD3::test_dreambooth_lora_sd3_checkpointing_checkpoints_total_limit - test_examples_utils.SubprocessCallException: Command `accelerate launch --config_file /tmp/tmp2yatc1ok/default_config.yml examples/dreamb...
FAILED examples/dreambooth/test_dreambooth_lora_sd3.py::DreamBoothLoRASD3::test_dreambooth_lora_sd3_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints - test_examples_utils.SubprocessCallException: Command `accelerate launch --config_file /tmp/tmp2yatc1ok/default_config.yml examples/dreamb...
============================================================= 3 failed in 27.89s =============================================================

After applying #8743:

============================================================ test session starts =============================================================
platform linux -- Python 3.12.3, pytest-8.2.2, pluggy-1.5.0
configfile: pyproject.toml
plugins: requests-mock-1.10.0, xdist-3.6.1, timeout-2.3.1
collected 3 items                                                                                                                            

examples/dreambooth/test_dreambooth_lora_sd3.py ...                                                                                    [100%]

============================================================= 3 passed in 40.13s =============================================================

@sayakpaul
Copy link
Member Author

Thanks @asomoza. I have left some comments on #8743. Let's get that merged soon.

Copy link
Collaborator

@DN6 DN6 left a comment

Choose a reason for hiding this comment

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

Nice 👍🏽 Good to merge once #8743 is handled.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks!

@asomoza
Copy link
Member

asomoza commented Jul 1, 2024

Maybe it's worth to add a second test with the train_text_encoder arg since it can fail even if the normal training passes the tests.

@sayakpaul sayakpaul merged commit 4e57aef into main Jul 2, 2024
11 checks passed
@sayakpaul
Copy link
Member Author

Thanks everyone for chiming in for this PR :)

@sayakpaul sayakpaul deleted the add-sd3-dreambooth-tests branch July 2, 2024 01:30
sayakpaul added a commit that referenced this pull request Dec 23, 2024
* add a test suite for SD3 DreamBooth

* lora suite

* style

* add checkpointing tests for LoRA

* add test to cover train_text_encoder.
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.

5 participants