Fix flaky RuntimeWarning during array reductions#10030
Merged
jrbourbeau merged 1 commit intodask:mainfrom Mar 8, 2023
Merged
Conversation
RuntimeWarning during array reductionsRuntimeWarning during array reductions
j-bennet
approved these changes
Mar 7, 2023
Contributor
j-bennet
left a comment
There was a problem hiding this comment.
Looks good. Still makes me wonder why the test is only failing intermittently.
Member
Author
|
In [1]: import numpy as np
In [2]: np.empty([2, 2], dtype="float32")
Out[2]:
array([[1.67e-43, 1.36e-43],
[1.60e-43, 1.54e-43]], dtype=float32)In [10]: np.empty([1, 2], dtype="float64")[0][0]
Out[10]: 2.058335917824e-312My hunch (this is really just a guess) is that some downstream operations might not like some of the values |
RuntimeWarning during array reductionsRuntimeWarning during array reductions
Member
Author
|
Okay, so I've run CI 6 times here and haven't seen the |
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.
This is sort of a shot in the dark. We've got some (pretty rare) flaky
RuntimeWarning: invalid value encountered in reducewarnings being emitted intest_reductions_2D(see full traceback below). The warning occurs when we're determining the output meta dtype usingnp.empty. This PR suggests we usenp.onesinstead ofnp.emptyto make things more deterministic. Again, not totally sure if this actually solves the flaky warning, but it might, and the change here seems harmless anyways.I'll run CI here a few times to see if we encounter the
test_reductions_2DerrorTraceback:
EDIT: Also xref #8892, which is related