Skip to content

Conversation

Aishwarya0811
Copy link
Contributor

@Aishwarya0811 Aishwarya0811 commented Oct 7, 2025

What does this PR do?

Fix MPS compatibility in get_1d_sincos_pos_embed_from_grid
Add dtype parameter with auto-detection for MPS devices. MPS doesn't support
float64, so the function now automatically uses float32 on MPS while maintaining
float64 on CUDA/CPU for backward compatibility. Users can also explicitly
override the dtype if needed.

Fixes #12432

Before submitting

Who can review?

@bghira
@DN6

@DN6
Copy link
Collaborator

DN6 commented Oct 8, 2025

@bot /style

Copy link
Contributor

github-actions bot commented Oct 8, 2025

Style fix is beginning .... View the workflow run here.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Aishwarya0811
Copy link
Contributor Author

@DN6 @bghira I’d really appreciate it if you could review the PR. If it resolves the issue as expected, please consider approving the contribution

@bghira
Copy link
Contributor

bghira commented Oct 8, 2025

it looks good, it mirrors how i was going to approach it. i have health issues this week and might take time to return a response, but i am following along. thank you for your contribution.

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.

get_1d_sincos_pos_embed_from_grid uses float64 unavailable on MPS
4 participants