[WIP] Derive a scope's symbol table once per scope - #2519
Draft
ThrudPrimrose wants to merge 1 commit into
Draft
Conversation
… edge symbols_defined_at walks every descriptor in the SDFG. propagate_memlet derived it per memlet, so building a program cost O(scopes x descriptors) sympy work: on a 2000-line generated kernel, 8845 walks over 2082 descriptors, 81% of a 183s parse. Callers that propagate several memlets through one scope node now derive it once and pass it down; Data.free_symbols is memoized, invalidated by the property setter that is the only way its sources can change (they are tuples and sympy expressions, so none can be edited in place); and the scan reads a symbol's name rather than printing it through sympy. Same parse: 38s.
Collaborator
Author
|
Holding this on the extended branch for now: the win is large on generated kernels and small on the cloudsc corpus, so it wants more evidence before landing on main. |
Collaborator
Author
|
Reopened -- keeping it as a draft. The change is running on the extended branch meanwhile, which is where the generated-kernel numbers come from. |
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.
symbols_defined_atwalks every descriptor in the SDFG, andpropagate_memletderived it once permemlet, so building a program cost O(scopes x descriptors) sympy work -- on a 2000-line generated
kernel, 8845 walks over 2082 descriptors, 81% of a 183 s parse. Callers propagating several memlets
through one scope node now derive it once,
Data.free_symbolsis memoized behind the propertysetter that is the only way its sources can change, and the descriptor scan reads
s.nameinsteadof printing the symbol.
The second kernel is measured on the
extendedbranch: it needs a data-dependent shape main'sfrontend refuses, so main cannot parse it either way.