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: Ensure seed is based on RNG State #1193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KennethEnevoldsen
Copy link
Contributor

@KennethEnevoldsen KennethEnevoldsen commented Sep 3, 2024

The global seed (see also #942) cause variance in performance estimation depending on the order in which tasks are run, we see an example here:

embeddings-benchmark/results#19 (comment)

This PR solved the specific issue presented in the PR. In #942 I propose a more general fix to this issue, but this PR as well as using a consistent seed will naturally cause slightly different scores as RNG states change.

We might want to avoid merging this change until we change the major version (and then do #942 fully).

Checklist

  • Run tests locally to make sure nothing is broken using make test.
  • Run the formatter to format the code using make lint.

@KennethEnevoldsen
Copy link
Contributor Author

@Samoed and @artemsnegirev would love your opinion on this as well

@Samoed
Copy link
Contributor

Samoed commented Sep 3, 2024

Maybe it's better to use fix_seed from transformers, because it will fix seed for torch with different devices?

UPD. I read #942, and I think that part of fix_seed can be reused for fixing seed, because it use old format for numpy there

@KennethEnevoldsen
Copy link
Contributor Author

Maybe it's better to use fix_seed from transformers, because it will fix seed for torch with different devices?

But this will still be influenced by the order of operations? (we essentially do this already within the abstasks). It will also be influenced by code-changes.

@isaac-chung isaac-chung modified the milestones: v2.0.0, mmteb Sep 10, 2024
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