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

Use Numba's Generator support #1245

Merged

Conversation

brandonwillard
Copy link
Member

@brandonwillard brandonwillard commented Oct 9, 2022

Closes #814.

  • Find a combination of packages that works with the required dev version of Numba
  • dirichlet isn't currently supported in Numba.
  • gumbel isn't currently supported in Numba.
  • binomial isn't currently supported in Numba.
    Object-mode is being used. This will need a follow-up issue for a non-object-mode implementation.
  • hypergeometric isn't currently supported in Numba.
    Object-mode is being used. This will need a follow-up issue for a non-object-mode implementation.
  • scan runs performed without merging produce slightly different sample results between Numba and Python modes.
    This might be due to the extra RNG state copys in the Python RandomVariable.perform implementations, but I haven't checked yet.
    Update: It was due to the copys, and they've been added to the Numba implementations; however, they require the use of object-mode, which is somewhat undesirable. This will need a follow-up issue for a non-object-mode implementation.

@brandonwillard brandonwillard added important Numba Involves Numba transpilation random variables Involves random variables and/or sampling labels Oct 9, 2022
@brandonwillard brandonwillard self-assigned this Oct 9, 2022
@ricardoV94

This comment was marked as resolved.

@brandonwillard brandonwillard marked this pull request as draft October 9, 2022 06:19
@brandonwillard brandonwillard force-pushed the enable-Numba-Generators branch 14 times, most recently from c111b34 to f7b5dca Compare October 10, 2022 01:37
@codecov
Copy link

codecov bot commented Oct 10, 2022

Codecov Report

Merging #1245 (31b77a2) into main (31b77a2) will not change coverage.
The diff coverage is n/a.

❗ Current head 31b77a2 differs from pull request most recent head 9304396. Consider uploading reports for the commit 9304396 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1245   +/-   ##
=======================================
  Coverage   74.12%   74.12%           
=======================================
  Files         174      174           
  Lines       48654    48654           
  Branches    10353    10353           
=======================================
  Hits        36064    36064           
  Misses      10300    10300           
  Partials     2290     2290           

@brandonwillard brandonwillard marked this pull request as ready for review October 10, 2022 20:18
@brandonwillard brandonwillard force-pushed the enable-Numba-Generators branch 2 times, most recently from 68c1716 to 40fa538 Compare October 14, 2022 20:52
@brandonwillard
Copy link
Member Author

brandonwillard commented Oct 14, 2022

OK, this should be good merge once the Numba 0.57 RC release is created containing all the Generator support.

@brandonwillard
Copy link
Member Author

The current failure will be fixed by #1496.

@brandonwillard brandonwillard marked this pull request as ready for review May 8, 2023 14:59
Copy link
Member

@Smit-create Smit-create left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks! Just to note, there are a few codecov warnings.

@brandonwillard brandonwillard merged commit 4b26667 into aesara-devs:main May 9, 2023
@brandonwillard brandonwillard deleted the enable-Numba-Generators branch May 9, 2023 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
important Numba Involves Numba transpilation random variables Involves random variables and/or sampling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Numba's new RandomState and Generator support
3 participants