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

[LoRA] allow big CUDA tests to run properly for LoRA (and others) #9845

Merged
merged 45 commits into from
Jan 10, 2025
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8696fbb
allow big lora tests to run on the CI.
sayakpaul Nov 2, 2024
06b3919
print
sayakpaul Nov 2, 2024
b062bd9
print.
sayakpaul Nov 2, 2024
360935c
print
sayakpaul Nov 2, 2024
1d1248a
print
sayakpaul Nov 2, 2024
f5550e3
print
sayakpaul Nov 2, 2024
4cd5a3c
print
sayakpaul Nov 2, 2024
a901420
more
sayakpaul Nov 2, 2024
d659f1c
print
sayakpaul Nov 2, 2024
96d27ff
remove print.
sayakpaul Nov 2, 2024
8510f98
remove print
sayakpaul Nov 2, 2024
9fe7b91
directly place on cuda.
sayakpaul Nov 2, 2024
286af0e
remove pipeline.
sayakpaul Nov 2, 2024
741a44f
remove
sayakpaul Nov 2, 2024
e818907
fix
sayakpaul Nov 2, 2024
3ed98a1
fix
sayakpaul Nov 2, 2024
9124f28
spaces
sayakpaul Nov 2, 2024
a938831
quality
sayakpaul Nov 2, 2024
bd94852
updates
sayakpaul Nov 3, 2024
1760419
directly place flux controlnet pipeline on cuda.
sayakpaul Nov 3, 2024
021f0de
torch_device instead of cuda.
sayakpaul Nov 3, 2024
ee662cf
style
sayakpaul Nov 3, 2024
c46331f
device placement.
sayakpaul Nov 3, 2024
ad4d7a7
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Nov 5, 2024
207579b
fixes
sayakpaul Nov 5, 2024
7f27d2d
fixes
sayakpaul Nov 5, 2024
876dfdb
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Nov 5, 2024
1740d83
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Nov 18, 2024
48c3bd3
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Nov 20, 2024
295315c
add big gpu marker for mochi; rename test correctly
a-r-r-o-w Nov 20, 2024
704392a
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Nov 22, 2024
77cfc79
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Nov 23, 2024
75e3850
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Nov 27, 2024
e10caf4
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Dec 2, 2024
58b79f2
address feedback
sayakpaul Dec 2, 2024
c7a64b8
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Dec 4, 2024
8b952cb
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Dec 8, 2024
79ca87e
resolve conflicts.
sayakpaul Dec 20, 2024
168aff7
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Dec 25, 2024
008f34f
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Dec 25, 2024
44db423
fix
sayakpaul Dec 25, 2024
50e59dc
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Dec 27, 2024
f1ab9f3
resolve conflicts.
sayakpaul Jan 9, 2025
03e11f1
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Jan 9, 2025
2d2c972
Merge branch 'main' into allow-flux-lora-tests
sayakpaul Jan 10, 2025
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
10 changes: 8 additions & 2 deletions tests/pipelines/mochi/test_mochi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
import unittest

import numpy as np
import pytest
import torch
from transformers import AutoTokenizer, T5EncoderModel

from diffusers import AutoencoderKLMochi, FlowMatchEulerDiscreteScheduler, MochiPipeline, MochiTransformer3DModel
from diffusers.utils.testing_utils import (
enable_full_determinism,
nightly,
numpy_cosine_similarity_distance,
require_big_gpu_with_torch_cuda,
require_torch_gpu,
slow,
torch_device,
Expand Down Expand Up @@ -261,7 +264,10 @@ def test_vae_tiling(self, expected_diff_max: float = 0.2):


@slow
@nightly
sayakpaul marked this conversation as resolved.
Show resolved Hide resolved
@require_torch_gpu
@require_big_gpu_with_torch_cuda
@pytest.mark.big_gpu_with_torch_cuda
class MochiPipelineIntegrationTests(unittest.TestCase):
prompt = "A painting of a squirrel eating a burger."

Expand All @@ -275,7 +281,7 @@ def tearDown(self):
gc.collect()
torch.cuda.empty_cache()

def test_cogvideox(self):
def test_mochi(self):
generator = torch.Generator("cpu").manual_seed(0)

pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview", torch_dtype=torch.float16)
Expand All @@ -293,7 +299,7 @@ def test_cogvideox(self):
).frames

video = videos[0]
expected_video = torch.randn(1, 16, 480, 848, 3).numpy()
expected_video = torch.randn(1, 19, 480, 848, 3).numpy()
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for catching!


max_diff = numpy_cosine_similarity_distance(video, expected_video)
assert max_diff < 1e-3, f"Max diff is too high. got {video}"
Loading