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

Pass keyword arguments to test_approx when checking thunks #247

Merged
merged 3 commits into from
May 23, 2022

Conversation

devmotion
Copy link
Member

Just ran into a test issue where I need nans=true as keyword argument to isapprox (cf #220) but it was not forwarded when testing pullbacks with chunks.

@oxinabox oxinabox changed the title Pass keyword arguments to test_approx when checking chunks Pass keyword arguments to test_approx when checking thunks May 23, 2022
Copy link
Member

@oxinabox oxinabox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely the correct behavior, regardless of if we do #220 or not.

I am not sure what is with the CI errors in Julia 1.0 on some plateforms but not others though.

@devmotion
Copy link
Member Author

I am not sure what is with the CI errors in Julia 1.0 on some plateforms but not others though.

These test errors all seem to happen in checks that involve thunks. So I assume these tests were a bit brittle before but passed (usually) with the default atol=0 and rtol=sqrt(eps()) settings. With this PR, however, they are also run with atol = rtol = 1e-9 which probably uncovers these issues.

@devmotion
Copy link
Member Author

devmotion commented May 23, 2022

A second observation is that the failing tests involve comparisons of Float64 and Float32. This might explain why it's an issue on some architectures only, and why atol = rtol = 1e-9 might be problematic.

Edit: And the test is stochastic on purpose it seems.

@devmotion
Copy link
Member Author

Test errors should be fixed now. If there are no additional comments, I'll merge when the CR downstream tests pass.

@devmotion devmotion merged commit 43bd90b into main May 23, 2022
@devmotion devmotion deleted the dw/chunks_test_approx branch May 23, 2022 13:29
@oxinabox
Copy link
Member

And the test is stochastic on purpose it seems.

Right the stocasticity isn't on purpose, we just need to trick type inference into failing.
Which your solution does, while also removing stocasticity, so nice work 👍

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.

2 participants