Skip to content

Remove stateful updates#192

Merged
inducer merged 13 commits into
mainfrom
thg/remove-stateful-updates
Jun 2, 2021
Merged

Remove stateful updates#192
inducer merged 13 commits into
mainfrom
thg/remove-stateful-updates

Conversation

@thomasgibson

@thomasgibson thomasgibson commented May 21, 2021

Copy link
Copy Markdown
Collaborator

Supercedes: #180 and #58

Requires: inducer/arraycontext#8 and inducer/arraycontext#9

@inducer inducer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One drive-by comment here for now. More soon.

Comment thread meshmode/dof_array.py Outdated
Comment thread meshmode/dof_array.py Outdated
@thomasgibson thomasgibson requested a review from inducer May 27, 2021 18:34
Comment thread meshmode/dof_array.py Outdated
Comment on lines +429 to +430
# Special case which avoids a copy
return _flatten(ary[0])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Special case which avoids a copy
return _flatten(ary[0])
# can avoid a copy if reshape succeeds
return _flatten(ary[0])

?

Do you think the same special case should be added to unflatten? That way it has the potential of doing a zero-copy roundtrip. I don't know of any place that would actually make use of that though.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? I'm a bit hesitant to touch unflatten and there are no stateful updates going on there. @inducer?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point! I'm fine with leaving it as is.

thomasgibson and others added 2 commits May 27, 2021 15:35

@inducer inducer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! LGTM. FYI, I sharpened the no-copy conditional in flatten a bit, a9951a1.

Comment thread examples/simple-dg.py
Comment on lines +318 to +333
return DOFArray(
actx,
data=tuple(
actx.call_loopy(
knl(),
mat=self.get_local_face_mass_matrix(afgrp, volgrp, dtype),
vec=vec_i.reshape(
volgrp.mesh_el_group.nfaces,
volgrp.nelements,
afgrp.nunit_dofs
)
)["result"]
for afgrp, volgrp, vec_i in zip(all_faces_discr.groups,
vol_discr.groups, vec)
)
)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not necessarily pushing for it, but is there any reason this didn't become an einsum?

@inducer inducer enabled auto-merge (squash) June 2, 2021 18:06
@inducer inducer merged commit e05184b into main Jun 2, 2021
@inducer inducer deleted the thg/remove-stateful-updates branch June 2, 2021 18:41
thomasgibson added a commit that referenced this pull request Jun 8, 2021
inducer pushed a commit that referenced this pull request Jun 8, 2021
* Revert connection kernels to pre-#192

* Don't revert L2ProjectionInverseDiscretizationConnection
inducer added a commit that referenced this pull request Jun 13, 2021
inducer added a commit that referenced this pull request Jun 18, 2021
* Revert "Revert connection kernels to pre-#192 (#217)"

This reverts commit 35d4520.

* Add custom iname tags to DirectDiscretizationConnection kernels

* Point req.txt for arraycontext, loopy

* Point req.txt loopy back to main

* Firedrake CI install: use loopy from git

* DirectCnx/InterpolationBatch: add, use _global_from_element_indices

* Do not update loopy in Fdrake CI for now

* Point req.txt back to main for arraycontext

* DirectConnection: add code path with in-place updates

* DirectConnection: revert kernel transforms back to old-style for non-inplace kernels

* Ensure test coverage of non-inplace DirectConnection kernels

* InterpolationBatch: Drop transform strategy based on iname tags for now

* DirectDiscretizationConnection: Fix kernel names, hash keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lazy evaluation Anything related to lazy evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updating how we flatten DOF arrays in anticipation for lazy evaluation

3 participants