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

compiler: Implement graceful lowering of derivatives (aka "unexpansion") #2060

Merged
merged 61 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f799a72
compiler: Prototype unexpansion
FabioLuporini Nov 24, 2022
ffc8c21
compiler: Revamp code generation from _C_ctype
FabioLuporini Nov 25, 2022
91eee45
compiler: Support trivial unexpanded-derivatives examples
FabioLuporini Nov 26, 2022
0eddd5d
dsl: Patch cross_derivative evaluation
FabioLuporini Nov 26, 2022
63f41e8
dsl: Introduce Spacing subclass
FabioLuporini Nov 28, 2022
a94ab05
compiler: Patch StencilDimension reconstruction
FabioLuporini Nov 28, 2022
ce7c96c
compiler: Extend unexpansion machinery
FabioLuporini Nov 26, 2022
4d63f17
compiler: Support StencilDimension in estimate_cost
FabioLuporini Dec 3, 2022
380d262
compiler: Enhance fusion upon lower_index_derivative
FabioLuporini Dec 3, 2022
45b5fa4
compiler: Rework is_cross rule for Cluster fusion
FabioLuporini Dec 10, 2022
8805cd9
compiler: Implement maximal fusion for lowered IndexDerivatives
FabioLuporini Dec 12, 2022
573ba59
compiler: Patch profiling in presence of StencilDimensions
FabioLuporini Dec 12, 2022
fda18ef
compiler: Improve IndexDerivative lowering to catch duplicates
FabioLuporini Dec 12, 2022
be02291
compiler: Enhance pow_to_mul to work around SymPy misbehavior
FabioLuporini Dec 13, 2022
c069dfe
compiler: Rework globals generation for device backends
FabioLuporini Dec 13, 2022
573b4cb
compiler: Rework weights generation for device backends
FabioLuporini Dec 13, 2022
eb8616c
compiler: Patch index mode detection with StencilDimensions
FabioLuporini Dec 15, 2022
0044b3b
compiler: Add IndexDerivative.mapper
FabioLuporini Dec 22, 2022
fb6c226
compiler: Patch lower_index_derivative
FabioLuporini Dec 23, 2022
9a6679a
tests: Patch draft flaky unexpansion test
FabioLuporini Dec 23, 2022
958c9a0
compiler: Patch lower_index_derivatives
FabioLuporini Dec 23, 2022
3f73098
compiler: Patch globs codegen for deterministic output
FabioLuporini Dec 27, 2022
8d28be1
compiler: Relax Properties manipulation methods
FabioLuporini Dec 27, 2022
3eecf4d
compiler: Change IndexDerivative.mapper
FabioLuporini Dec 30, 2022
9a843ba
compiler: Add IterationSpace.translate
FabioLuporini Jan 3, 2023
52e076a
compiler: Move IndexSum.mapper to IndexDerivative.mapper
FabioLuporini Jan 3, 2023
a993d0d
compiler: Patch IndexDerivative.mapper
FabioLuporini Jan 5, 2023
417dac4
compiler: Relax WAR dependencies involving shared Array
FabioLuporini Jan 9, 2023
9c6ac52
compiler: Maximize likelihood of fusing clusters over shm
FabioLuporini Jan 9, 2023
42627b1
compiler: Improve data dependence analysis
FabioLuporini Jan 10, 2023
fead97c
compiler: Add Jump mixin class
FabioLuporini Jan 11, 2023
19f6af3
compiler: Patch collect_derivative pass
FabioLuporini Jan 13, 2023
17ab99b
compiler: Add shm-related heuristics to Cluster fusion
FabioLuporini Jan 20, 2023
c2044d5
compiler: Add Properties methods
FabioLuporini Jan 21, 2023
60e2e03
compiler: Make IndexDerivatives comparable; fix their CSE
FabioLuporini Jan 25, 2023
e5ea4d6
compiler: Draft Guards, akin to Properties
FabioLuporini Jan 31, 2023
9d579b1
compiler: Rework customization of clusters visitors
FabioLuporini Jan 31, 2023
fcc2e86
compiler: Fix Cluster properties normalization at init
FabioLuporini Jan 31, 2023
50025f5
compiler: Extend uxreplace to substitute types as well
FabioLuporini Feb 3, 2023
3496221
compiler: Fixup linearization with isolated routines
FabioLuporini Feb 3, 2023
fcfa448
misc: Fixup pep8 violations
FabioLuporini Feb 4, 2023
c562c30
compiler: Introduce AffineIndexAccessFunction
FabioLuporini Feb 6, 2023
43e700f
compiler: Improve IndexDerivative
FabioLuporini Feb 6, 2023
a588b6d
compiler: Enhance dtype retrieval
FabioLuporini Feb 6, 2023
18bc963
compiler: Tidy up Interval.expand()
FabioLuporini Feb 6, 2023
2640df3
compiler: Drop has_free for compatibility with older SymPy versions
FabioLuporini Feb 7, 2023
5113825
examples: Update expected notebook output
FabioLuporini Feb 7, 2023
0297597
compiler: Patch codegen upon pow_to_mul
FabioLuporini Feb 7, 2023
2c5eb4d
misc: Postpone codegen speed improvement
FabioLuporini Feb 7, 2023
403a194
examples: Update expected output
FabioLuporini Feb 8, 2023
62e0fc8
examples: Disable openmp where necessary due to issue 2061
FabioLuporini Feb 8, 2023
0c801bd
compiler: Exploit SubDim.local to support nasty deps in examples
FabioLuporini Feb 8, 2023
a97f6e6
ci: Drop support for gcc5, sympy1.7, sympy1.8
FabioLuporini Feb 8, 2023
77eae11
compiler: Add IndexDerivative.total_order
FabioLuporini Feb 8, 2023
9af12f4
arch: Enable openmp with nvc on CPU
FabioLuporini Feb 8, 2023
f33fcfc
ci: Add back forgotten gcc-11
FabioLuporini Feb 9, 2023
88fafce
compiler: Tweak lower_index_derivatives
FabioLuporini Feb 9, 2023
dde53cc
compiler: IndexDerivative.total_order -> depth
FabioLuporini Feb 10, 2023
2ce2797
misc: Tweak docstring
FabioLuporini Feb 10, 2023
95b482c
compiler: Lift overrides from AffineIndexAccessFunc into IndexAccessFunc
FabioLuporini Feb 10, 2023
0453503
arch: Add amdclang mapping
FabioLuporini Feb 10, 2023
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
Prev Previous commit
Next Next commit
dsl: Introduce Spacing subclass
  • Loading branch information
FabioLuporini committed Feb 7, 2023
commit 63f41e82bd746267723ec62dfa22c405d47cc41c
10 changes: 7 additions & 3 deletions devito/types/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__all__ = ['Dimension', 'SpaceDimension', 'TimeDimension', 'DefaultDimension',
'CustomDimension', 'SteppingDimension', 'SubDimension', 'ConditionalDimension',
'ModuloDimension', 'IncrDimension', 'BlockDimension', 'StencilDimension',
'dimensions']
'Spacing', 'dimensions']


Thickness = namedtuple('Thickness', 'left right')
Expand Down Expand Up @@ -320,6 +320,10 @@ def _arg_check(self, args, size, interval):
__getnewargs_ex__ = Pickable.__getnewargs_ex__


class Spacing(Scalar):
pass


class BasicDimension(Dimension, Symbol):

__doc__ = Dimension.__doc__
Expand All @@ -328,7 +332,7 @@ def __new__(cls, *args, **kwargs):
return Symbol.__new__(cls, *args, **kwargs)

def __init_finalize__(self, name, spacing=None, **kwargs):
self._spacing = spacing or Scalar(name='h_%s' % name, is_const=True)
self._spacing = spacing or Spacing(name='h_%s' % name, is_const=True)


class DefaultDimension(Dimension, DataSymbol):
Expand Down Expand Up @@ -357,7 +361,7 @@ def __new__(cls, *args, **kwargs):
return DataSymbol.__new__(cls, *args, **kwargs)

def __init_finalize__(self, name, spacing=None, default_value=None, **kwargs):
self._spacing = spacing or Scalar(name='h_%s' % name, is_const=True)
self._spacing = spacing or Spacing(name='h_%s' % name, is_const=True)
self._default_value = default_value or 0

@cached_property
Expand Down
4 changes: 2 additions & 2 deletions devito/types/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from devito.types.basic import Scalar
from devito.types.dense import Function
from devito.types.dimension import (Dimension, SpaceDimension, TimeDimension,
SteppingDimension, SubDimension)
Spacing, SteppingDimension, SubDimension)

__all__ = ['Grid', 'SubDomain', 'SubDomainSet']

Expand Down Expand Up @@ -147,7 +147,7 @@ def __init__(self, shape, extent=None, origin=None, dimensions=None,
ndim = len(shape)
assert ndim <= 3
dim_names = self._default_dimensions[:ndim]
dim_spacing = tuple(Scalar(name='h_%s' % n, dtype=dtype, is_const=True)
dim_spacing = tuple(Spacing(name='h_%s' % n, dtype=dtype, is_const=True)
for n in dim_names)
dimensions = tuple(SpaceDimension(name=n, spacing=s)
for n, s in zip(dim_names, dim_spacing))
Expand Down