Skip to content

enable 7 cases on XPU#11503

Merged
DN6 merged 10 commits into
huggingface:mainfrom
yao-matrix:misc-xpu
May 9, 2025
Merged

enable 7 cases on XPU#11503
DN6 merged 10 commits into
huggingface:mainfrom
yao-matrix:misc-xpu

Conversation

@yao-matrix
Copy link
Copy Markdown
Contributor

@a-r-r-o-w @DN6 , pls help review, thx.

yao-matrix added 2 commits May 6, 2025 05:08
Signed-off-by: Yao Matrix <matrix.yao@intel.com>
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)
Copy link
Copy Markdown
Contributor Author

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 and id_cond is wrong, both A100 and XPU will report below error

def forward(self, input: Tensor) -> Tensor:
  return F.linear(input, self.weight, self.bias)
    E       RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x2 and 1280x1024)

I checked the needed size for these 2 tensors and use the correct tensor

@@ -357,5 +358,5 @@ def test_consisid(self):
video = videos[0]
expected_video = torch.randn(1, 16, 480, 720, 3).numpy()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

expected_video here is generated by RNG, so suppose this is a in-complete case, so for this PR, I enable the case to run on XPU, need re-check the numerical correctness after expected_video correctly set.

expected_video = torch.randn(1, 16, 480, 720, 3).numpy()

max_diff = numpy_cosine_similarity_distance(video, expected_video)
max_diff = numpy_cosine_similarity_distance(video.cpu(), expected_video)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

need to cpu, since expected_video is in cpu, numpy_cosine_similarity_distance only supports 2 tensors in same device.

@yao-matrix
Copy link
Copy Markdown
Contributor Author

@DN6 @a-r-r-o-w , pls help review and comment, thx very much.

Copy link
Copy Markdown
Contributor

@a-r-r-o-w a-r-r-o-w left a comment

Choose a reason for hiding this comment

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

thanks, lgtm!

@DN6 DN6 merged commit 2d38089 into huggingface:main May 9, 2025
7 of 8 checks passed
@yao-matrix yao-matrix deleted the misc-xpu branch May 11, 2025 22:53
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.

3 participants