Skip to content

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

Merged
merged 10 commits into from
May 9, 2025
Merged

enable 7 cases on XPU #11503

merged 10 commits into from
May 9, 2025

Conversation

yao-matrix
Copy link
Contributor

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

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
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
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.

@@ -357,5 +358,5 @@ def test_consisid(self):
video = videos[0]
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
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
Contributor Author

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

Copy link
Member

@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