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

Add simple svi tests to pyroapi.tests #5

Merged
merged 7 commits into from
Oct 12, 2019
Merged

Add simple svi tests to pyroapi.tests #5

merged 7 commits into from
Oct 12, 2019

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented Oct 10, 2019

Addresses #2

This is a good challenge to see how we can make tests generic.

Tasks

Triaged

  • fix funsor plate size error: test_data_generate_plate()

@fritzo fritzo added WIP and removed WIP labels Oct 11, 2019
@fritzo
Copy link
Member Author

fritzo commented Oct 11, 2019

@neerajprad Could you help me out with the last two remining NumPyro errors:

  1. scipy.linalg._solve_toeplitz.array' has no attribute '__reduce_cython__'

2.RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject

@neerajprad
Copy link
Member

Yes, taking a look at those errors now.

@neerajprad
Copy link
Member

neerajprad commented Oct 12, 2019

I am not able to replicate those failures. Could you point me to which tests are failing? The only failures that I see are Attribute error for.data not existing for jax arrays, and a bunch of NotImplementedErrors which xfail.

@fritzo
Copy link
Member Author

fritzo commented Oct 12, 2019

  1. the ufunc error is raised by test/test_tests.py::test_generate_data[numpy]
  2. toeplitz error is raised by e.g. test/test_tests.py::test_generate_data_plate[numpy]

BTW I am running these on my mac. Should I do anything special to get an environment?

@neerajprad
Copy link
Member

BTW I am running these on my mac. Should I do anything special to get an environment?

I don't think so, maybe just updating scipy should be fine? My scipy version is 1.3.1 and numpy is 1.17.2. Both of these tests pass if I remove the .data attribute.

@fritzo
Copy link
Member Author

fritzo commented Oct 12, 2019

Thanks, it looks like this is a Python 3.7 issue; I can see passing tests on Python 3.6.

Looks like the last blocker is pyro-ppl/pyro#2062

@neerajprad
Copy link
Member

Just merged #2062 in Pyro.

@fritzo
Copy link
Member Author

fritzo commented Oct 12, 2019

I'll fix the .data bug and push.

@@ -3,6 +3,8 @@
from pyroapi import pyro_backend
from pyroapi.tests import * # noqa F401

pytestmark = pytest.mark.filterwarnings("ignore::numpyro.compat.util.UnsupportedAPIWarning")
Copy link
Member

@neerajprad neerajprad Oct 12, 2019

Choose a reason for hiding this comment

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

I agree, it will makes more sense to have this in pyro-api instead.

Copy link
Member

@neerajprad neerajprad left a comment

Choose a reason for hiding this comment

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

Looks great. I will try to increase coverage in numpyro once this merges.

@fritzo fritzo merged commit 0a5b0de into master Oct 12, 2019
@fritzo fritzo deleted the svi-tests branch October 12, 2019 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants