-
Notifications
You must be signed in to change notification settings - Fork 102
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
Adds interoperability with PyTensor (and PyMC) #621
Conversation
@mrava87 I've been having a very hard time satisfying the version requirements of all libraries. PyTensor does not support numpy 2 (pymc-devs/pytensor#689). Devito only supports numpy 2 for the latest versions, so dropping to numpy 1.x forces one to use a very old version of devito... which in turns makes it not support newer versions of sympy (above 0.13). On the other hand, PyTorch requires versions of sympy>=0.13.1. Errata: looks like devito does support numpy 1.x for the newest versions. I'll give this another try! |
@mrava87 I think I managed to build it, the trick was to prevent the pip command which install pytorch to overwrite the sympy installation. I did this setting pytorch version to be below 2.5. Note that these version changes are only required for the |
…for dev dependencies, include pytensor as doc dependency
@mrava87 managed to get everything working after a lot of back and forth with versions :) |
Great! I’ll take a look in the next couple of days 😀 |
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.
This looks great 🚀
I just left a few minor comments... I am happy for this to be merged as soon as you feel it's ready 😄
@mrava87 I actually tested the yml file as it current stands, it didnt install the correct numpy. The only way I could get it to work was to version pin:
I'm reluctant to add this to the "standard" environment-dev.yml since that would force everyone to use old versions just so that pytensor still works. I think instead I will remove pytensor from the yml files, and put a check to not execute the pytensor tests if numpy>=2. What do you think? |
I agree. In general I would strive for avoiding forcing upper limits on versions and doing that only as a temporary measure... especially when it comes to For the Feel free to merge after you add the check to the pytensor tests |
Description
Adds the ability to call use PyLops Linear Operators as PyTensor Ops. This allows PyMC to use PyLops LinearOperators inside of their models.
The PR also includes an example of Bayesian linear regression (
examples/plot_bayeslinearregr.py
) demonstrating this capability.Changes
In addition to the main functionality, this PR issues several fixes:
__pycache__
Notes
Although I added everything to intersphinx, the documentation links is not appearing in my local documentation. Don't know if this is by design or if I need to change anything.