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

Order of rewrites is only respected if kwarg position is used #170

Closed
ricardoV94 opened this issue Aug 28, 2022 · 1 comment · Fixed by #208
Closed

Order of rewrites is only respected if kwarg position is used #170

ricardoV94 opened this issue Aug 28, 2022 · 1 comment · Fixed by #208
Labels
bug Something isn't working good first issue Good for newcomers graph rewriting Involves the implementation of rewrites to Aesara graphs help wanted Extra attention is needed

Comments

@ricardoV94
Copy link
Contributor

ricardoV94 commented Aug 28, 2022

I could be wrong, but when working on pymc-devs/pymc#6072, it seemed that the order of the rewrites in the database is only respected when using the kwarg position. Otherwise it seems to be ignored, and only the order of definition matters.

So:

aeppl/aeppl/rewriting.py

Lines 234 to 236 in 8ce3c63

logprob_rewrites_db.register(
"measurable_ir_rewrites", measurable_ir_rewrites_db, -10, "basic"
)

Should be:

logprob_rewrites_db.register( 
     "measurable_ir_rewrites", measurable_ir_rewrites_db, "basic", position=-10, 
 )
@ricardoV94
Copy link
Contributor Author

We should probably also leave an offset between pre-canonicalize and measurable_ir_rewrites (both are supposed to be at -10) in case anyone wants to introduce rewrites between those two phases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers graph rewriting Involves the implementation of rewrites to Aesara graphs help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants