-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freeze constant arrays #354
base: main
Are you sure you want to change the base?
Conversation
@@ -232,6 +232,11 @@ class _FromGroupPickData(Generic[ArrayT]): | |||
from_element_indices: ArrayT | |||
is_surjective: bool | |||
|
|||
@memoize_method | |||
def indexed_dof_pick_lists(self, actx): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not completely sure if this is the right object to maintain the memoization dict. (Lmk if you think something's not ideal here)
11339a4
to
d27c898
Compare
Rerunning to check how things go now that inducer/arraycontext#203 is in. |
d27c898
to
0591cbb
Compare
@@ -232,6 +232,12 @@ class _FromGroupPickData(Generic[ArrayT]): | |||
from_element_indices: ArrayT | |||
is_surjective: bool | |||
|
|||
@keyed_memoize_method(key=lambda actx: type(actx)) | |||
def indexed_dof_pick_lists(self, actx): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why this is needed? I would have figured that DataWrapper
deduplication would take care of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is computing pt_data[pt_data_0[i, j]]
i.e. a constant that should be computed AOT rather than in every compiled_rhs
. See all these terms.
As discussed, I think I would prefer to do this as part of a more general constant folding pass in pytato. (And in this particular case, I think the temporaries being produced are |
No description provided.