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

Move slow tests to nightly #4526

Merged
merged 5 commits into from
Aug 9, 2023
Merged

Move slow tests to nightly #4526

merged 5 commits into from
Aug 9, 2023

Conversation

DN6
Copy link
Collaborator

@DN6 DN6 commented Aug 8, 2023

What does this PR do?

Move certain slow tests to nightly. The following modules are not present in this list of important pipelines and are some of the slowest tests in the CI/CD pipeline.

tests/pipelines/stable_diffusion/test_stable_diffusion_pix2pix_zero.py
tests/pipelines/stable_diffusion/test_stable_diffusion_panorama.py

The test_full_model test in tests/pipelines/text_to_video/test_text_to_video.py is a similar test to test_two_step_model except that it runs for a greater number of inference steps. I propose moving the long running test to nightly and keeping the shorter 2 step test in SlowTests

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@DN6 DN6 requested a review from sayakpaul August 8, 2023 06:41
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 8, 2023

The documentation is not available anymore as the PR was closed or merged.

@@ -539,47 +539,6 @@ def test_stable_diffusion_2_pix2pix_inversion(self):

assert np.abs(expected_slice - image_slice.cpu().numpy()).max() < 5e-2

def test_stable_diffusion_pix2pix_full(self):
Copy link
Member

Choose a reason for hiding this comment

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

Why are we getting rid of it entirely?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The pipeline wasn't prioritised in this list (under highly important and important)

So I moved all the slow tests to nightly.

Comment on lines 175 to 189
def test_two_step_model(self):
expected_video = load_numpy(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/text_to_video/video.npy"
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/text_to_video/video_2step.npy"
)

pipe = TextToVideoSDPipeline.from_pretrained("damo-vilab/text-to-video-ms-1.7b")
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")
pipe = pipe.to(torch_device)

prompt = "Spiderman is surfing"
generator = torch.Generator(device="cpu").manual_seed(0)

video_frames = pipe(prompt, generator=generator, num_inference_steps=25, output_type="pt").frames
video_frames = pipe(prompt, generator=generator, num_inference_steps=2, output_type="pt").frames
video = video_frames.cpu().numpy()

assert np.abs(expected_video - video).mean() < 5e-2
Copy link
Member

Choose a reason for hiding this comment

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

Works for me!

Comment on lines 192 to 211
@nightly
@skip_mps
@require_torch_gpu
class TextToVideoSDPipelineNightlyTests(unittest.TestCase):
def test_full_model(self):
expected_video = load_numpy(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/text_to_video/video_2step.npy"
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/text_to_video/video.npy"
)

pipe = TextToVideoSDPipeline.from_pretrained("damo-vilab/text-to-video-ms-1.7b")
pipe = pipe.to("cuda")
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to(torch_device)

prompt = "Spiderman is surfing"
generator = torch.Generator(device="cpu").manual_seed(0)

video_frames = pipe(prompt, generator=generator, num_inference_steps=2, output_type="pt").frames
video_frames = pipe(prompt, generator=generator, num_inference_steps=25, output_type="pt").frames
video = video_frames.cpu().numpy()

assert np.abs(expected_video - video).mean() < 5e-2
Copy link
Member

Choose a reason for hiding this comment

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

If the two step model is passing the assertion, I think it's okay to remove it from nightly unless we have a strong reason to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just to clarify. Do you mean you want to keep the two step and remove the full test or keep the full and remove the two step?

Copy link
Member

Choose a reason for hiding this comment

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

Remove the full and keep the two steps.

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Sweet!

@DN6 DN6 merged commit a67ff32 into main Aug 9, 2023
10 checks passed
@kashif kashif deleted the cleanup-tests-slow-tests-move2nightly branch September 11, 2023 19:06
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* move slow pix2pixzero tests to nightly

* move slow panorama tests to nightly

* move txt2video full test to nightly

* clean up

* remove nightly test from text to video pipeline
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.

None yet

3 participants