Skip to content

compiler: Revamp DDA for SubDimensions - #3033

Open
FabioLuporini wants to merge 5 commits into
mainfrom
tweak-graph-construction-final
Open

FabioLuporini wants to merge 5 commits into
mainfrom
tweak-graph-construction-final

Conversation

@FabioLuporini

@FabioLuporini FabioLuporini commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

fixes #809

@FabioLuporini
FabioLuporini force-pushed the tweak-graph-construction-final branch 2 times, most recently from 11f46b0 to 3a0ad97 Compare September 24, 2026 14:00
@FabioLuporini
FabioLuporini force-pushed the tweak-graph-construction-final branch from 3a0ad97 to 68f52ce Compare September 24, 2026 14:08
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.57951% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.02%. Comparing base (4f386a6) to head (1c1616f).

Files with missing lines Patch % Lines
tests/test_subdomains.py 83.66% 33 Missing ⚠️
tests/test_mpi.py 66.66% 7 Missing ⚠️
devito/exceptions.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3033      +/-   ##
==========================================
+ Coverage   83.93%   84.02%   +0.09%     
==========================================
  Files         258      258              
  Lines       55676    56154     +478     
  Branches     4772     4797      +25     
==========================================
+ Hits        46732    47185     +453     
- Misses       8128     8155      +27     
+ Partials      816      814       -2     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.71% <89.25%> (+0.02%) ⬆️
pytest-gpu-gcc- 78.69% <92.22%> (+0.13%) ⬆️
pytest-gpu-icx- 78.62% <92.22%> (+0.12%) ⬆️
pytest-gpu-nvc-nvidiaX 69.24% <89.25%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mloubout mloubout left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not completely sure i follow the reasoning. This seems to add soem very strong constraints on what can be done with subdomains.

Comment thread devito/types/grid.py
) from None
sub_dimensions.append(constructor(f'i{k.name}', k, thickness))
sdshape.append(thickness)
else:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure why this is better than just having it inthe try?

Comment thread devito/types/dimension.py Outdated

def _arg_check(self, args, *_args, **kwargs):
# These modules depend on Dimension, so importing them above would cycle
from devito.mpi import mpi_raise # noqa: PLC0415

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this wouldn't be an issue with mpi_rais in exception.py with the rest of the exception stuff

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

# SubDimensions check for at least space_order interior points
# at *op.apply time*, accounting for runtime overrides. Without
# an explicit middle, the gap assumption is unchecked
gap = sympy.Dummy(nonnegative=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

dropped, revamped, simplified

Comment thread devito/types/dimension.py Outdated
return

d = self.root
if args.grid is not None and args.grid.is_distributed(d):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure why kwargs would be ignored if the grid is not distributed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

dropped, revamped, simplified

Comment thread devito/types/dimension.py Outdated

# Runtime overrides do not change the compiled stencil order
items = [f.space_order for f in args.op.input if f.is_DiscreteFunction]
space_order = max(items, default=0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unless f is a Function on subdomain that uses that specific dimension i don't see why those checks are needed. This also seemse to be brutal as it checks every function including all of the ones that have nothing to do with this subdimension

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

dropped, revamped, simplified

@FabioLuporini

Copy link
Copy Markdown
Contributor Author

@mloubout

about

I'm not completely sure i follow the reasoning. This seems to add soem very strong constraints on what can be done with subdomains.

yes, but basically this is all about ensuring that we're not dealing with degenerate SubDomains (e.g. left and right regions overlapping, or an interior region that doesn't have enough points for the plausible stencils, etc)

these conditions are necessary because data dependence analysis has to make some assumptions in order to return True/False in several cases

@mloubout

Copy link
Copy Markdown
Contributor

e.g. left and right regions overlapping

Preventing this makes things like (acoustic water, elastic earth) very complicated because if you can't overlap you cannot have transition domain.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve data dependence analysis with SubDimensions

2 participants