[DAPHNE-#854] Add Passes for Matrix Result Property Recording and Insertion in IR#855
Merged
pdamme merged 79 commits intodaphne-project:mainfrom May 23, 2025
Merged
Conversation
…s successfull for sparsity property
- Undid unrelated changes (e.g., change of the sparsity threshold, change of DaphneLib tmp directory, unnecessarily added includes, change of top-k for --statistics). - Removed WhileLoopInvariantCodeMotionPass; this PR reintroduced it (after it was removed from the codebase a while ago), but doesn't use it. - Made the CLI args --enable-property-recording and --enable-property-insert mutually exclusive (using both at the same time doesn't make sense). - Changed recordProperties-kernel to really count the number of non-zeros also in CSRMatrix, because even CSRMatrix could store some zeros explicitly. - Added instantiations of recordProperties-kernel for CSRMatrix with all numeric value types currently supported. - Moved test cases from test/codegen/ to test/util/, because this feature is not about codegen. - Undid some formatting changes. - Improved wording in some comments/docs. - Added missing license headers. - And some more minor things.
c97660b to
b3d9d2a
Compare
- The recorded true data properties are stored to the file specified by --properties-file-path (not always to "properties.json"). - Slight polishing of the code for data property recording and insertion.
- The newly introduced CLI args are not documented in RunningDaphneLocally.md, because the new feature is experimental and not the first thing we want users to look at. - Instead, added a minimal page in the developer docs.
pdamme
approved these changes
May 23, 2025
Collaborator
pdamme
left a comment
There was a problem hiding this comment.
Thanks for this new feature, @StoeckOverflow! It is useful for research and development related to optimizations based on interesting data properties in DAPHNE. Overall, your code was already in a good shape. I still cleaned it up a bit (see my commits for details) and now it's ready to be merged.
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.
This PR introduces two new passes:
RecordPropertiesPassandInsertPropertiesPass. These passes enable the recording of runtime properties of matrix result objects and the reinsertion of these properties into the IR (Intermediate Representation) during subsequent runs. This process aims to improve optimization and analysis.Changes:
Property Recording Pass:
PropertyLoggerto capture and save properties in a JSON file.Property Insertion Pass:
Features:
enable_property_recording: Enables the recording of matrix properties.enable_property_insert: Enables reinserting properties from a previous run.properties_file_path: Specifies the path to the JSON file for storing or retrieving matrix properties.Documentation:
RunningDaphneLocally.mdto reflect the new configuration options and command-line flags.Testing:
scf.for,scf.if,scf.while).