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

[fix] Fix MatryoshkaLoss crash if the first dimension is not the biggest #2719

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

tomaarsen
Copy link
Collaborator

Hello!

Pull Request overview

  • Fix MatryoshkaLoss crash if the first dimension is not the biggest

Details

The first dimension is ran "normally", while all future ones use the cached results from the first run and then truncate to the required dimension. Consequently, if you use a non-largest dimension as the first dimension, then you'll cache a dimension that's too small. This PR sorts the Matryoshka dimensions from large to small to ensure that we cache the largest dimension.

Thanks @philschmid for reporting this.

  • Tom Aarsen

tomaarsen added 2 commits June 5, 2024 15:32
As this one will be cached for the other runs
I forgot to re-enable pre-commit, oops
@tomaarsen tomaarsen merged commit 1608eb8 into UKPLab:master Jun 5, 2024
9 checks passed
@tomaarsen tomaarsen deleted the fix/matryoshka_ascending_dims branch June 5, 2024 14:37
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.

1 participant