-
Notifications
You must be signed in to change notification settings - Fork 177
pyop3 #3318
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
Draft
connorjward
wants to merge
590
commits into
main
Choose a base branch
from
connorjward/pyop3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
pyop3 #3318
Conversation
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
Blasted double counting. In general the layout algorithm still needs some more work to handle ragged things.
Now need to extend to regions as well.
Aiming to get codegen working in parallel. Now serial and parallel things are much more similar than before. Also ported some PyOP2 tests.
Basically I've had to make sure that we propagate Scalars (instead of numbers) everywhere when we don't know things. Definitely needs cleaning up.
Works for axis trees too! Next is to keep up the disk caching work and get the right mapping for the buffer indices. Then can maybe start translating more traversals into this form.
I.e. it's actually still broken.
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.
Replace PyOP2 with pyop3.
Thesis link
Summary
Data structures for unstructured meshes are much more complicated than N-dimensional arrays. Firedrake therefore does an awful lot of very involved bookkeeping to make sure that things work.
The key contribution of pyop3 is a new abstraction for describing data layouts, called axis trees. Axis trees are able to describe mesh data layouts completely from a high-level specification. This has the dual set of benefits of: (a) being able to delete a lot of complex Firedrake code, and (b) we can now express a whole suite of algorithms that would otherwise be very difficult to write.
You can think of pyop3 as 'a JIT-compiled numpy for unstructured mesh data'.
pyop3
Core concepts
Expected benefits
API changes visible in Firedrake
function.dat.datanow always returns a flat arrayThis means that
coordinates.dat.datagives back an array with shape(nverts*gdim,)instead of(nverts, gdim).Explanation
Now that data layouts are much more flexible than before it no longer makes sense to apply multi-dimensional shape to dats. For example, consider a mixed function space with both scalar and vector subspaces.
mixed_function.dat.datacannot straightforwardly have multi-dimensional shape.Similarly, since we can now permute data layouts freely, it is valid for coordinates to be stored with effective layout
(gdim, nverts).To avoid all this confusion
dat.dataalways returns something flat. The axis tree (dat.axes) provides the information needed to interpret it.Drop support for variable layer extruded meshes
Users should use a cell submesh instead to get the right behaviour.
Explanation
The functionality appeared not to be used by the community (e.g. thetisproject/thetis#405) and porting the functionality would have been a large amount of work.
.sub()expects a tuple instead of integer for tensor spaces.function.dat.vecis now a function not a property.This allows one to pass block size to the generated Vec.