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

Running mcmc within jit might cause tracer leak #2000

Open
fehiepsi opened this issue Mar 7, 2025 · 0 comments
Open

Running mcmc within jit might cause tracer leak #2000

fehiepsi opened this issue Mar 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@fehiepsi
Copy link
Member

fehiepsi commented Mar 7, 2025

Bug Description

A part of #1981
During MCMC run, we cache some functions so that later run might be faster. However, this might cause some leaks.

Steps to Reproduce

JAX_CHECK_TRACER_LEAKS=1 pytest -vs test/infer/test_mcmc.py::test_chain_inside_jit
JAX_CHECK_TRACER_LEAKS=1 pytest -vs test/infer/test_mcmc.py::test_chain_jit_args_smoke
JAX_CHECK_TRACER_LEAKS=1 pytest -vs test/infer/test_mcmc.py::test_reuse_mcmc_run
JAX_CHECK_TRACER_LEAKS=1 pytest -vs test/infer/test_mcmc.py::test_model_with_multiple_exec_paths

Expected Behavior

No tracer leaks. A solution is to cache outside of jit context.

@fehiepsi fehiepsi added the bug Something isn't working label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant