[WIP] Cache proofs using canonicalized ASTs#1974
Closed
jacobhinkle wants to merge 21 commits intomainfrom
Closed
Conversation
This just defines the basic Term and Program types that can later be used for tracking simplifications. TODO: convenience operators for doing things like (a + b) % c using const Term& s.
Sizes of relevant types: ``` sizeof(PrimDataType)=4 sizeof(DataType)=96 sizeof(Val)=272 sizeof(TensorView)=368 sizeof(PolymorphicValue)=96 sizeof(FunctionSymbol)=8 sizeof(Term)=56 sizeof(std::vector<Term*>)=24 sizeof(std::vector<Val*>)=24 sizeof(std::vector<std::optional<int64_t>>)=16 sizeof(int64_t)=8 sizeof(std::variant<int64_t,bool>)=16 sizeof(std::variant<std::monostate,int64_t,bool>)=16 sizeof(std::variant<double,int64_t,bool>)=16 sizeof(std::variant<std::monostate,double,int64_t,bool>)=16 sizeof(RealPolymorphicScalar)=16 sizeof(simplification::ConstantValue)=16 ```
This is all we need for now I think. Next up is to add methods for recording proofs and simplifications, then I'll start to hack at expr_simplifier.cpp.
Note that this does not add initialization of a Program during lowering yet. Many tests are failing.
This also makes it so that simplifyExpr will work in standalone mode (i.e. all proofs are from scratch) if no ProgramGuard is active.
Collaborator
Author
|
This was an experiment in using a lightweight AST and some e-graph machinery for simplification. It was not meant to be merged so I am closing now. |
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.
No description provided.