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

Allow compile_kwargs in sample_smc #7702

Merged
merged 2 commits into from
Mar 3, 2025

Conversation

jessegrabowski
Copy link
Member

@jessegrabowski jessegrabowski commented Mar 1, 2025

Description

Allow compile_kwargs to be included among kernel_kwargs, so users can compile logp functions to numba/jax/torch. e.g. pm.sample_smc(..., compile_kwargs={'mode':'NUMBA'})

Necessary because the multiprocessors don't respect pytensor.config.change_flags context. But also we allow this everywhere else, so why not here too?

Related Issue

  • Closes #
  • Related to #

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pymc--7702.org.readthedocs.build/en/7702/

@jessegrabowski jessegrabowski added the SMC Sequential Monte Carlo label Mar 1, 2025
Copy link

codecov bot commented Mar 1, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.66%. Comparing base (d1aff0b) to head (5f630f5).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pymc/smc/kernels.py 85.71% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7702      +/-   ##
==========================================
- Coverage   92.67%   92.66%   -0.01%     
==========================================
  Files         107      107              
  Lines       18319    18325       +6     
==========================================
+ Hits        16977    16981       +4     
- Misses       1342     1344       +2     
Files with missing lines Coverage Δ
pymc/smc/sampling.py 99.30% <100.00%> (+0.01%) ⬆️
pymc/smc/kernels.py 97.82% <85.71%> (-0.35%) ⬇️

... and 1 file with indirect coverage changes

@jessegrabowski
Copy link
Member Author

Here's a gist with timings, to show this is doing the right thing:

https://gist.github.com/jessegrabowski/2ec8b44c3d21b4304e059e49d82b13c7

@ricardoV94 ricardoV94 merged commit cc90212 into pymc-devs:main Mar 3, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance SMC Sequential Monte Carlo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants