-
Notifications
You must be signed in to change notification settings - Fork 270
Fix Memleak in ASVGD #2003
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
Fix Memleak in ASVGD #2003
Conversation
…perature and repulsion_temperature to the SteinVIState; renamed _svgd_loss_and_grads => _loss_and_grads; added loss and repulsion temperature to signature of _loss_and_grads
| @pytest.mark.xfail( | ||
| os.getenv("JAX_CHECK_TRACER_LEAKS") == "1", reason="Expected tracer leak" | ||
| ) | ||
| def test_run_smoke(kernel, problem, method): |
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.
@fehiepsi do I remove the mark.xfail decorator?
@pytest.mark.xfail(
os.getenv("JAX_CHECK_TRACER_LEAKS") == "1", reason="Expected tracer leak"
)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.
I'm going to follow this and remove it.
Running
JAX_CHECK_TRACER_LEAKS=1 pytest -vs test/contrib/einstein/test_steinvi.py
passes now.
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.
Could you also remove the CI test: https://github.com/pyro-ppl/numpyro/blob/master/.github/workflows/ci.yml#L88 ?
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.
Thanks for the fix, Ola!
ASVGDhad a memory leak caused by assigning a JAX Tracer to an attribute. This PR resolves the issue by introducing a state tuple that is passed along with the optimization process instead.Changes:
TODO
Add leak check to unit testsIgnored following: Fix tracer leak in svi with mutable state #2001Related to #1982