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

Firedrake #20

Merged
merged 97 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
a2c6e94
Numbering logic
connorjward Dec 11, 2023
b0c4201
Tidy imports
connorjward Dec 11, 2023
41222cc
Fixes
connorjward Dec 12, 2023
f63cab6
Remove tensor.py and PetscMat changes
connorjward Dec 12, 2023
39ea9d3
Add error checks for indexing, tests passing
connorjward Dec 12, 2023
1834ee1
Add subset test
connorjward Dec 12, 2023
6387448
Add broken test, need to handle indexed maps
connorjward Dec 12, 2023
dd966dc
Fix indexing for indexed maps, worked immediately!
connorjward Dec 13, 2023
cb364d9
add useful method
connorjward Dec 14, 2023
b3812e2
WIP, fix labelling bugs
connorjward Dec 14, 2023
0cb9f0a
All tests passing
connorjward Dec 14, 2023
16a323e
Indexing stuff, tests pass
connorjward Dec 15, 2023
634c548
Add domain_index_exprs to allow indexing ragged maps nicely
connorjward Dec 15, 2023
3f97490
Can pass loop indices through to kernel, loop context requires thought
connorjward Dec 15, 2023
79141af
WIP, try to improve indexing with loop contexts
connorjward Dec 18, 2023
bf71b2a
WIP, need to redo index trees
connorjward Dec 19, 2023
f9b9b33
Lots of tests passing now, definitely the right abstraction
connorjward Dec 19, 2023
739f8e7
All tests are passing
connorjward Dec 19, 2023
c6461b1
Cleanup, tests passing
connorjward Dec 20, 2023
d6aff30
Remove old Tree class, tests passing
connorjward Dec 20, 2023
d5476a1
All tests passing
connorjward Dec 20, 2023
524daa0
Improve .iter() behaviour, all tests passing
connorjward Dec 21, 2023
77ca4d1
cleanup
connorjward Dec 21, 2023
a104926
Cleanup subset tests
connorjward Dec 21, 2023
75c25cc
Renumber arguments in kernel
connorjward Dec 21, 2023
3f0c472
Some matrix tests in Firedrake pass, some pyop3 tests are failing
connorjward Jan 9, 2024
dad2a6a
Add global type object
connorjward Jan 9, 2024
8684b29
Fixed matrix assembly (badly)
connorjward Jan 19, 2024
b123175
WIP most prior tests passing
connorjward Jan 22, 2024
5263c1c
WIP, begin adding context-sensitive pass
connorjward Jan 22, 2024
9c7556c
WIP, basic tests passing
connorjward Jan 22, 2024
c662ce0
WIP bit of cleanup
connorjward Jan 22, 2024
cd79243
Most tests passing
connorjward Jan 22, 2024
e2dce72
Only expected tests failing now
connorjward Jan 22, 2024
346d2a7
Remove old code from lower.py, better now, same 3 tests failing
connorjward Jan 22, 2024
53a1c11
WIP, temps are better
connorjward Jan 23, 2024
3efb7e3
Many tests pass, now fixing temp dims in a separate pass
connorjward Jan 23, 2024
297d9d0
expected tests pass
connorjward Jan 23, 2024
a6cac3c
Basic assignment works
connorjward Jan 23, 2024
e9b2e8b
WIP, start adding logic for variable temporary sizes
connorjward Jan 25, 2024
491b8d3
WIP, about to un-sum layouts
connorjward Jan 25, 2024
69175fa
Works for a fair few tests, back to Firedrake
connorjward Jan 25, 2024
f9d443e
Sparsity tabulation appears to work, but tests failing
connorjward Jan 25, 2024
ae0d3b6
All tests passing or xfailed
connorjward Jan 26, 2024
9436215
Tests passing, about to try something new on another branch
connorjward Jan 26, 2024
de3a975
WIP, try another approach for ragged maps
connorjward Jan 26, 2024
1404155
WIP, ragged map tests are failing
connorjward Jan 26, 2024
feeca4e
Only 2 tests failing
connorjward Jan 28, 2024
77c071e
Try something with called map contexts
connorjward Jan 29, 2024
c53b6f6
All tests now pass
connorjward Jan 29, 2024
d5f120a
Fix some sparsity bugs, tests passing
connorjward Jan 29, 2024
03907f4
WIP, tests passing
connorjward Jan 29, 2024
e041726
Add subst_layouts property, only one test fails
connorjward Jan 30, 2024
3b937d2
All tests passing now
connorjward Jan 30, 2024
bd34c6e
About to cleanup layout tabulation bits
connorjward Jan 30, 2024
aaf02ff
Cleanup code
connorjward Jan 30, 2024
d8e0d54
Big cleanup of layout code
connorjward Jan 30, 2024
c140b95
Cleanup, tests passing
connorjward Jan 30, 2024
b2f04f4
Cleanup, tests passing
connorjward Jan 30, 2024
bda6de9
Cleanup
connorjward Jan 30, 2024
247e831
Cleanup, tests passing
connorjward Jan 30, 2024
2489b57
cleanup
connorjward Jan 30, 2024
1c28378
cleanup
connorjward Jan 30, 2024
bd8c5d1
Can tabulate (basic) layouts that rely on an external loop index
connorjward Jan 30, 2024
03eafb5
Complete extra ragged test
connorjward Jan 31, 2024
5b8c92b
WIP, about to refactor index_exprs
connorjward Jan 31, 2024
00c1e25
WIP, tests passing
connorjward Feb 1, 2024
b6a049d
Remove collect_external_{loops,axes}
connorjward Feb 1, 2024
46042e8
WIP, non-ragged temp tests passing
connorjward Feb 1, 2024
24e390d
WIP, appear to produce the right layout for ragged things
connorjward Feb 2, 2024
a96257f
WIP, sparsity construction appears to work
connorjward Feb 2, 2024
94a71bf
Some tests fail, but Firedrake now appears to be working
connorjward Feb 2, 2024
cd90f07
More tests passing
connorjward Feb 5, 2024
f56071b
fixup
connorjward Feb 5, 2024
d246639
All tests passing, including the Firedrake ones
connorjward Feb 5, 2024
935697f
fixup for PyOP2 changes
connorjward Feb 5, 2024
5d33b62
Some lgmap muddling, BCs in Firedrake seem to work somewhat
connorjward Feb 6, 2024
f135345
Add symbolic and eager zeroing
connorjward Feb 9, 2024
896c920
WIP, add DummyKernelArgument and NA intent
connorjward Feb 13, 2024
9933424
WIP
connorjward Feb 19, 2024
5cb6a32
WIP
connorjward Feb 26, 2024
8c4790c
WIP
connorjward Feb 27, 2024
2b42823
WIP
connorjward Mar 1, 2024
180d265
Fixup
connorjward Mar 4, 2024
1af58f0
Renaming bits in codegen
connorjward Mar 5, 2024
3142d91
Begin adding support for labelled subsets
connorjward Mar 7, 2024
de36af3
undo not needed
connorjward Mar 7, 2024
7f00ec3
Crazy changes
connorjward Mar 8, 2024
18337f7
Seem to be getting somewhere!
connorjward Mar 8, 2024
ce18d86
Getting moderately far.
connorjward Mar 8, 2024
21295f0
Things aren't totally broken
connorjward Mar 11, 2024
a06f09a
Fix sparsity construction
connorjward Mar 12, 2024
933012c
Lots of Firedrake tests passing
connorjward Mar 13, 2024
631041e
Improve matrix construction
connorjward Mar 15, 2024
ecbe02e
Firedrake mixed assembly working.
connorjward Mar 18, 2024
ba35d80
Add no-copy accessors
connorjward Mar 18, 2024
456cdc5
Bits and pieces for Firedrake
connorjward Mar 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions pyop3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
# tracebacks for @property methods so we remove it here.
import pytools

del pytools.RecordWithoutPickling.__getattr__
try:
del pytools.RecordWithoutPickling.__getattr__
except AttributeError:
pass
del pytools


import pyop3.transforms
from pyop3.array import Array, HierarchicalArray, MultiArray, PetscMat
from pyop3.axtree import Axis, AxisComponent, AxisTree # noqa: F401
from pyop3.buffer import DistributedBuffer # noqa: F401
import pyop3.ir
import pyop3.transform
from pyop3.array import Array, HierarchicalArray, MultiArray

# TODO where should these live?
from pyop3.array.harray import AxisVariable
from pyop3.array.petsc import PetscMat, PetscMatAIJ, PetscMatPreallocator # noqa: F401
from pyop3.axtree import Axis, AxisComponent, AxisTree, PartialAxisTree # noqa: F401
from pyop3.buffer import DistributedBuffer, NullBuffer # noqa: F401
from pyop3.dtypes import IntType, ScalarType # noqa: F401
from pyop3.itree import ( # noqa: F401
AffineSliceComponent,
Expand All @@ -23,18 +31,25 @@
Subset,
TabulatedMapComponent,
)
from pyop3.itree.tree import ScalarIndex
from pyop3.lang import ( # noqa: F401
INC,
MAX_RW,
MAX_WRITE,
MIN_RW,
MIN_WRITE,
NA,
READ,
RW,
WRITE,
AddAssignment,
DummyKernelArgument,
Function,
Loop,
OpaqueKernelArgument,
Pack,
ReplaceAssignment,
do_loop,
loop,
)
from pyop3.tensor import Dat, Global, Mat, Tensor # noqa: F401
from pyop3.sf import StarForest, serial_forest, single_star
5 changes: 4 additions & 1 deletion pyop3/array/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# arguably put this directly in pyop3/__init__.py
# no use namespacing here really

from .base import Array # noqa: F401
from .harray import ( # noqa: F401
ContextSensitiveMultiArray,
HierarchicalArray,
MultiArray,
)
from .petsc import PackedPetscMatAIJ, PetscMat, PetscMatAIJ # noqa: F401
from .petsc import PetscMat, PetscMatAIJ # noqa: F401
8 changes: 3 additions & 5 deletions pyop3/array/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import abc

from pyop3.lang import KernelArgument
from pyop3.lang import KernelArgument, ReplaceAssignment
from pyop3.utils import UniqueNameGenerator


Expand All @@ -13,7 +13,5 @@ def __init__(self, name=None, *, prefix=None) -> None:
raise ValueError("Can only specify one of name and prefix")
self.name = name or self._name_generator(prefix or self._prefix)

@property
@abc.abstractmethod
def valid_ranks(self):
pass
def assign(self, other):
return ReplaceAssignment(self, other)
Loading
Loading