Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Freeze constant arrays #354

wants to merge 2 commits into from

Conversation

kaushikcfd
Copy link
Collaborator

No description provided.

@@ -232,6 +232,11 @@ class _FromGroupPickData(Generic[ArrayT]):
from_element_indices: ArrayT
is_surjective: bool

@memoize_method
def indexed_dof_pick_lists(self, actx):
Copy link
Collaborator Author

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)

@inducer
Copy link
Owner

inducer commented Oct 14, 2022

Rerunning to check how things go now that inducer/arraycontext#203 is in.

@@ -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):
Copy link
Owner

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.

Copy link
Collaborator Author

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.

@inducer
Copy link
Owner

inducer commented Oct 14, 2022

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 DOFArray-sized, which I find fairly big.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants