-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
WIP: Use single call to dsfmt_gv_genrand_uint32() for small ranges #5578
Changes from all commits
4c16113
43b3845
da64ec1
361708d
02992cf
1b256fe
7e6a6ea
2977c6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -383,7 +383,7 @@ C = randn(2,2) | |
|
||
for elty in (Float32, Float64, Complex64, Complex128, Int) | ||
if elty == Int | ||
srand(61516384) | ||
srand(61516300) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need to change this number? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because with the change, in this test the random matrices on 64 bit systems are the same as the random matrices on 32 bit systems before this change. This would introduce #5472 on 64 bit systems and break the tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to add a comment in the code for this kind of magic numbers. This discussion will be hard to find later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this ceases to be a magic number once 5472 gets fixed, presumably by changing
to use a hand picked epsilon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having a proper testing criterion that is unlikely to fail in general is better than relying on a magic random seed. cc: @jiahao @andreasnoackjensen There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might seem easier to just run the tests several times to fix a random seed with which the tests do not fail. However, this may cause problems in a long run. Suppose at some point of time in future, we update the RNG (upgrade the version or choose a better library), if the threshold is set too small, many of the tests may fail and we will end up re-choosing a lot of the seeds again. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect that we may simply multiply the threshold by 1e3 and drastically reduce the risk of running into testing failure, and the threshold will be still be small enough for the purpose of ensuring correctness. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I believe the current random seed was picked as a "good enough" first choice, but as we have continued to add linalg tests, tests further down in the test suite are picking up new matrices that are downstream in the rng. For now we could just up the fuzz factor on failing tests, but I do hope to put in proper error bounds at some point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jiahao I agree there are cases (e.g. matrices that are nearly singular) where this can become really tricky. For such cases, setting a magic seed is a reasonable stopgap. However, I think it is still worth considering better ways of setting up those tests in the long run. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's continue the discussion in #5605 |
||
d = rand(1:100, n) | ||
dl = -rand(0:10, n-1) | ||
du = -rand(0:10, n-1) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of this function seems to be a little bit messy. Would you please clean up following julia's four-space convention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, some hidden tabs removed.