Skip to content

Use vectorized jacobian in minimize ops #1558

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jul 28, 2025

This PR uses the more new experimental vectorized jacobian in the minimize/root Ops, with the goal of getting it more tested, as it won't be breaking any people's code.

The existing notebook revealed we were missing some rewrites to avoid Blockwise(IncSubtensor), that this PR also addresses. In the printed example we can see that the vectorized jacobian replaces a Scan with two IncSubtensors by two IncSubtensors on an expanded buffer. This should be much more performant for this sort of small graphs.

Either my chages introduce or reveal a bug on the notebook, so this is still a draft


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

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ricardoV94 ricardoV94 force-pushed the use_vectorized_jacobian_in_minimize_ops branch from 53721c4 to f1a8ae1 Compare July 28, 2025 14:31
@ricardoV94
Copy link
Member Author

This is hitting #1550 I don't know if because I introduced a bug that triggers it or what not. Let's fix that first and then come back to this

Also cover cases of AdvancedIncSubtensor with batch indices that were not supported before
@ricardoV94 ricardoV94 force-pushed the use_vectorized_jacobian_in_minimize_ops branch from f1a8ae1 to 7a7ad7a Compare July 29, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant