Set warn_only for unsupported deterministic algorithms#1145
Open
Set warn_only for unsupported deterministic algorithms#1145
warn_only for unsupported deterministic algorithms#1145Conversation
Signed-off-by: Tcc0403 <76503978+Tcc0403@users.noreply.github.com>
warn_only to prevent error for unsupported algorithmswarn_only for unsupported deterministic algorithms
Mecoli1219
approved these changes
Mar 14, 2026
Collaborator
There was a problem hiding this comment.
@Tcc0403 . Thanks for catching it. Just out of curiosity. Could you also provide the Torch & Transformers version? I couldn't reproduce the error with torch==2.8.0, transformers==5.3.0.
Collaborator
Author
Oh I'm on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Before the fix (current main branch):
After the fix (this PR):
Root cause:
torch.histcdoesn't support deterministic algorithmhttps://github.com/huggingface/transformers/blob/adc2f16bf1824f7b57c790b4cf3bc48f95ecec69/src/transformers/integrations/moe.py#L373
Testing Done
make testto ensure correctnessmake checkstyleto ensure code stylemake test-convergenceto ensure convergence