WIP: Implement a denormalize custom Jaxpr operator simplifying MCX logpdfs#71
Open
balancap wants to merge 46 commits intorlouf:masterfrom
Open
WIP: Implement a denormalize custom Jaxpr operator simplifying MCX logpdfs#71balancap wants to merge 46 commits intorlouf:masterfrom
denormalize custom Jaxpr operator simplifying MCX logpdfs#71balancap wants to merge 46 commits intorlouf:masterfrom
Conversation
…f by removing constants.
denormalize custom Jaxpr operator simplifying MCX logpdfsdenormalize custom Jaxpr operator simplifying MCX logpdfs
Author
|
@rlouf As we discussed on Slack, there is quite a bit of additional complexity to add to this PR to handle properly the support I'll start with a fairly dummy implementation, getting it working, and I think then we can iterate on it to make it less naive and using more properly symbolic programming concept (I started looking at Oryx codebase on that). |
Owner
|
That sounds like a very good plan to me! I'll have a closer look too when my big PR is merged. |
f8f3e6b to
965f6dd
Compare
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.
Overview
This PR is implementing a generic
denormalizedecorator which removes normalizing constants in a logpdf. Per call to contributions in #65.Implementation
The current implementation is a two passes algorithm:
addandsuboperations where one of the input is a constant;Once the latter simplifying mapping is found, the rest of decorator code is just a simple execution pass on the Jaxpr, skipping the operations where a simplifying mapping exists.
Limitations
Even though we try to have a fairly generic implementation, some simplifications are not supported at the moment. For instance, we do not propagate constant simplification in
concatormuloperations. These cases could be supported in the future, if it happens to be a performance bottleneck in MCX.