Skip to content

Stabilize special function in fast_compile#2289

Open
ricardoV94 wants to merge 1 commit into
pymc-devs:mainfrom
ricardoV94:tree1
Open

Stabilize special function in fast_compile#2289
ricardoV94 wants to merge 1 commit into
pymc-devs:mainfrom
ricardoV94:tree1

Conversation

@ricardoV94

@ricardoV94 ricardoV94 commented Jul 11, 2026

Copy link
Copy Markdown
Member

Closes #2288

The compromise is: if the user writes code using helpers that resemble the stable scipy/numpy look-alike (e.g., pt.special.logsumexp), we make an effort to stabilize them in fast_compile (if the returned graph/op is not already the stable from, which it is for e.g., log1p).

We don't promise to stabilize the equivalent graphs written in naive form. If it happens to be stabilized today, because the naive form is the same those helpers return that's luck, not a promise.

@kratsg kratsg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This seems fine to me on some level. I imagine if a user wants the graph to fast-compile without the stabilized form, they'd use the naive version? I would also probably expect something in the documentation about stabilization to mention api equivalency with scipy (re: stablization) just so that it isn't a hidden "feature"?

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.

BUG: logsumexp has different behavior in FAST_COMPILE vs FAST_RUN (no stabilize)

2 participants