Skip to content

More stable fix for JAX Multinomial #1339

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

Merged
merged 1 commit into from
Apr 1, 2025

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Apr 1, 2025

#1328 was not good enough for the test in PyMC :(

I changed it to stop taking draws once remaining_n drops to zero. This should be more robust against numerical precision issues for valid parameters. It's also what our numba implementation is doing, so at least they are aligned:

if remaining_n <= 0:
break

Or I should perhaps just gone with the suggestion @educhesne gave.

I confirm PyMC is now happy


📚 Documentation preview 📚: https://pytensor--1339.org.readthedocs.build/en/1339/

@ricardoV94 ricardoV94 added the bug Something isn't working label Apr 1, 2025
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.01%. Comparing base (afb7695) to head (3debfdc).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1339   +/-   ##
=======================================
  Coverage   82.01%   82.01%           
=======================================
  Files         203      203           
  Lines       48805    48805           
  Branches     8688     8688           
=======================================
  Hits        40026    40026           
  Misses       6627     6627           
  Partials     2152     2152           
Files with missing lines Coverage Δ
pytensor/link/jax/dispatch/random.py 94.01% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ricardoV94
Copy link
Member Author

I'm gonna go away and merge this, it has slowed down things enough as it is :)

@ricardoV94 ricardoV94 merged commit 0f5da80 into pymc-devs:main Apr 1, 2025
74 checks passed
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

Successfully merging this pull request may close these issues.

1 participant