Deprecate ExternalCOp#2292
Merged
Merged
Conversation
Make DimShuffle a plain COp that emits per-node specialized C from the static permutation and shape, replacing the runtime-spec dimshuffle.c kernel. ExternalCOp read and re-parsed that file on every DimShuffle instantiation (~200-400us per instance, paid throughout graph construction and rewriting); construction is now ~5us. C implementation adapted from the DimShuffle migration in pymc-devs#2218.
ricardoV94
force-pushed
the
remove_external_c_op
branch
from
July 13, 2026 14:15
301a58a to
49563d5
Compare
jessegrabowski
approved these changes
Jul 13, 2026
Member
|
nice, i really like #2218, happy to see parts of it going in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DimShuffle was the only one, and it paid the price. Every instantiaton READ FROM DISK! For the most common glue Op that's just outrageous.
It also penalized the C-backend because the generated function stayed polymorphic. Cherry picked (with some opinionated changes of mine) from #2218. Was too pissed to wait.
Deprecated the ExternalCOp. According to the bot once it's out for good roughly two-thirds of the pytensor/link/c/op.py module (~415 of 647 lines) goes away with it.