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

Add fast operator evaluation for tensor-product discretizations #362

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8bd3969
start updating grad
a-alveyblanc Jul 25, 2024
0afe732
add TODOs
a-alveyblanc Jul 25, 2024
9c4c150
add strong form tensor product gradient
a-alveyblanc Jul 26, 2024
c264cf9
Merge branch 'main' of https://github.com/inducer/grudge into tensor-…
a-alveyblanc Aug 31, 2024
e105a64
start working on weak-overint case for TP elements
a-alveyblanc Sep 5, 2024
a3f7f7e
start brainstorming better ways to handle weak overintegration
a-alveyblanc Sep 6, 2024
830c2e0
small changes
a-alveyblanc Sep 6, 2024
102f6e0
do not support overintegration (yet)
a-alveyblanc Sep 6, 2024
597fcc9
fix gradient tests
a-alveyblanc Sep 6, 2024
790ab13
fix tensor product gradient
a-alveyblanc Sep 6, 2024
91e3121
do not compute stiffness matrix; apply mass to all axes and diff op t…
a-alveyblanc Sep 6, 2024
9ff324b
arg name change
a-alveyblanc Sep 6, 2024
7b50e32
add fast operator eval for weak and strong divergence
a-alveyblanc Sep 6, 2024
230c1bd
add tensor product inverse mass
a-alveyblanc Sep 6, 2024
30f984e
tag mass operator as such
a-alveyblanc Sep 6, 2024
92b54a2
add fast operator eval for mass operator application
a-alveyblanc Sep 7, 2024
34b1cd6
toward overintegration support
a-alveyblanc Sep 7, 2024
b8e312e
minor changes to adjust for changes in pytato
a-alveyblanc Sep 8, 2024
a79a603
adjust operators to accept 1D tensor product discretizations
a-alveyblanc Sep 8, 2024
51884a7
Merge branch 'main' of https://github.com/inducer/grudge into tensor-…
a-alveyblanc Sep 9, 2024
c8d0a92
checkpoint before adding wadg + overintegration + fast operator evalu…
a-alveyblanc Sep 12, 2024
ad0d2e4
tag axes of grad result
a-alveyblanc Sep 12, 2024
ca22480
add WADG + overintegration for simplices
a-alveyblanc Sep 12, 2024
092a6cc
add WADG + overintegration for simplices
a-alveyblanc Sep 12, 2024
bea91ad
start fixing up fast operator eval + overintegration + wadg
a-alveyblanc Sep 13, 2024
8182571
small changes
a-alveyblanc Sep 16, 2024
4cacc6b
overintegration + fast operator evaluation
a-alveyblanc Sep 19, 2024
73ba29a
first round of clean-ups
a-alveyblanc Sep 19, 2024
0a431d4
start updating face mass for TP
a-alveyblanc Sep 23, 2024
3dfaeec
undo face mass changes; add rough version of bilinear form evaluator
a-alveyblanc Oct 4, 2024
851a1f9
rename bilinear forms file; add rough draft of SeparableBilinearForm
a-alveyblanc Oct 4, 2024
91c87df
minor change: fix typing on generic dispatching function
a-alveyblanc Oct 4, 2024
351ae62
changes after review; bilinear forms now only internal
a-alveyblanc Oct 8, 2024
d174c40
get things working with quadrature; improve test_mass_operator_inverse
a-alveyblanc Oct 13, 2024
21a5855
remove unused variable
a-alveyblanc Oct 13, 2024
4e8b5f8
remove large refined mesh files
a-alveyblanc Oct 13, 2024
16f7f36
add default quadrature for computing bilinear forms
a-alveyblanc Oct 22, 2024
4d8d468
get all tests passing with quadrature rules + numpy array context
a-alveyblanc Oct 27, 2024
5b53482
fix merge conflicts
a-alveyblanc Oct 27, 2024
0a91985
some ruff fixes
a-alveyblanc Oct 28, 2024
53abda5
fix failing MPI wave op test
a-alveyblanc Oct 29, 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
29 changes: 29 additions & 0 deletions grudge/array_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
)
from warnings import warn

from grudge.transform.metadata import OutputIsTensorProductDOFArrayOrdered

from meshmode.array_context import (
PyOpenCLArrayContext as _PyOpenCLArrayContextBase,
PytatoPyOpenCLArrayContext as _PytatoPyOpenCLArrayContextBase,
Expand Down Expand Up @@ -138,6 +140,33 @@ def __init__(self, queue: "pyopencl.CommandQueue",
super().__init__(queue, allocator,
wait_event_queue_length, force_device_scalars)

def transform_loopy_program(self, t_unit):
knl = t_unit.default_entrypoint

# {{{ process tensor product specific metadata

# NOTE: This differs from the lazy case b/c we don't have access to axis
# tags that can be manipulated pre-execution. In eager, we update
# strides/loop nest ordering for the output array
if knl.tags_of_type(OutputIsTensorProductDOFArrayOrdered):
new_args = []
for arg in knl.args:
if arg.is_output:
arg = arg.copy(dim_tags=(
f"N{len(arg.shape)-1},"
+ ",".join(f"N{i}"
for i in range(len(arg.shape)-1))
))

new_args.append(arg)

knl = knl.copy(args=new_args)
t_unit = t_unit.with_kernel(knl)

# }}}

return super().transform_loopy_program(t_unit)

# }}}


Expand Down
Loading