-
Notifications
You must be signed in to change notification settings - Fork 6.1k
enable 7 cases on XPU #11503
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
enable 7 cases on XPU #11503
Changes from all commits
7cd66d2
ccf542b
b8be6d8
2f2b2fa
690fce1
c3c042f
5faa3cd
50e5070
a37bd67
7dc40d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,10 @@ | |
from diffusers import AutoencoderKLCogVideoX, ConsisIDPipeline, ConsisIDTransformer3DModel, DDIMScheduler | ||
from diffusers.utils import load_image | ||
from diffusers.utils.testing_utils import ( | ||
backend_empty_cache, | ||
enable_full_determinism, | ||
numpy_cosine_similarity_distance, | ||
require_torch_gpu, | ||
require_torch_accelerator, | ||
slow, | ||
torch_device, | ||
) | ||
|
@@ -316,19 +317,19 @@ def test_vae_tiling(self, expected_diff_max: float = 0.4): | |
|
||
|
||
@slow | ||
@require_torch_gpu | ||
@require_torch_accelerator | ||
class ConsisIDPipelineIntegrationTests(unittest.TestCase): | ||
prompt = "A painting of a squirrel eating a burger." | ||
|
||
def setUp(self): | ||
super().setUp() | ||
gc.collect() | ||
torch.cuda.empty_cache() | ||
backend_empty_cache(torch_device) | ||
|
||
def tearDown(self): | ||
super().tearDown() | ||
gc.collect() | ||
torch.cuda.empty_cache() | ||
backend_empty_cache(torch_device) | ||
|
||
def test_consisid(self): | ||
generator = torch.Generator("cpu").manual_seed(0) | ||
|
@@ -338,8 +339,8 @@ def test_consisid(self): | |
|
||
prompt = self.prompt | ||
image = load_image("https://github.com/PKU-YuanGroup/ConsisID/blob/main/asserts/example_images/2.png?raw=true") | ||
id_vit_hidden = [torch.ones([1, 2, 2])] * 1 | ||
id_cond = torch.ones(1, 2) | ||
id_vit_hidden = [torch.ones([1, 577, 1024])] * 5 | ||
id_cond = torch.ones(1, 1280) | ||
|
||
videos = pipe( | ||
image=image, | ||
|
@@ -357,5 +358,5 @@ def test_consisid(self): | |
video = videos[0] | ||
expected_video = torch.randn(1, 16, 480, 720, 3).numpy() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
max_diff = numpy_cosine_similarity_distance(video, expected_video) | ||
max_diff = numpy_cosine_similarity_distance(video.cpu(), expected_video) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to cpu, since |
||
assert max_diff < 1e-3, f"Max diff is too high. got {video}" |
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.
the size of the
id_vit_hidden
andid_cond
is wrong, both A100 and XPU will report below errorI checked the needed size for these 2 tensors and use the correct tensor