Skip to content

compiler: precompute interp pos/weights - #3000

Open
mloubout wants to merge 1 commit into
mainfrom
cire-int-invariants
Open

compiler: precompute interp pos/weights#3000
mloubout wants to merge 1 commit into
mainfrom
cire-int-invariants

Conversation

@mloubout

Copy link
Copy Markdown
Contributor

No description provided.

@mloubout mloubout added compiler API api (symbolics, types, ...) labels Aug 10, 2026
@mloubout
mloubout force-pushed the cire-int-invariants branch from cda0311 to f120563 Compare August 10, 2026 18:29
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.79412% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.99%. Comparing base (110463b) to head (90a9144).

Files with missing lines Patch % Lines
devito/operations/interpolators.py 96.38% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3000      +/-   ##
==========================================
- Coverage   83.54%   82.99%   -0.56%     
==========================================
  Files         257      257              
  Lines       53922    54018      +96     
  Branches     4613     4619       +6     
==========================================
- Hits        45050    44832     -218     
- Misses       8074     8374     +300     
- Partials      798      812      +14     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.56% <81.89%> (+<0.01%) ⬆️
pytest-gpu-gcc- 78.20% <97.79%> (+0.03%) ⬆️
pytest-gpu-icx- 78.14% <97.79%> (+0.03%) ⬆️
pytest-gpu-nvc-nvidiaX ?

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 force-pushed the cire-int-invariants branch 2 times, most recently from e823fb0 to 6f9e7c6 Compare August 10, 2026 19:34
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mloubout
mloubout force-pushed the cire-int-invariants branch 7 times, most recently from da8dee9 to e4977c2 Compare August 11, 2026 03:10
``coords`` handed in by ``SparseFunction._arg_defaults``. Mirrors
sinc's `_arg_defaults`: regenerates the tables from the persisted
shift set, so a pickled/rebuilt interpolator (decoupled workers)
still emits data for every table the operator was compiled with."""

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.

some blank spaces and comments here would help

tag = _shift_tag(shifts)
sfname = self.sfunction.name
sfdim = self.sfunction._sparse_dim
gp_name = f'{sfname}_gp{tag}'

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.

maybe some blank lines and comments would help in this function

Comment thread devito/operations/interpolators.py Outdated
else:
symbols.append(Symbol(name=f'p{d}', dtype=dtype))
return DimensionTuple(*symbols, getters=self.grid.dimensions)
def _tables_for(self, key):

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'd change the name to emphasize that something is being created, such as _tabulate

Comment thread devito/operations/interpolators.py
Comment thread devito/operations/interpolators.py Outdated
`(gridpoints, coeffs_per_dim)` for that shift set; mirrors sinc's
`interpolation_coeffs` cached_property but keyed on `shifts`."""
self._shifts_used.add(key)
shifts = list(key) if key else None

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.

probably as_list

Comment thread devito/types/sparse.py
values = super()._arg_values(estimate_memory=estimate_memory, **kwargs)
if estimate_memory:
return values
onames = [o.name for o in self.grid.origin_symbols]

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.

blank line

Comment thread devito/types/sparse.py
values.update(self.interpolator._arg_defaults(
coords=coords, sfunc=self, origin=origin
))
return values

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.

blank line

Comment thread devito/operations/interpolators.py
shifts = list(key) if key else None
gp, coeffs = self._tables_for(key)
args[gp.name] = _cell_indices(coords, grid, shifts, spacing, origin)
for i, w in enumerate(coeffs):

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.

can probably do with a comprehension but not sure if it actually gets harder to read

@mloubout
mloubout force-pushed the cire-int-invariants branch 2 times, most recently from b8bd51c to 90a9144 Compare August 11, 2026 11:30
@mloubout mloubout added the no-pro-trigger Skip the devitopro submodule update on merge label Aug 11, 2026
@mloubout
mloubout force-pushed the cire-int-invariants branch from 90a9144 to 200302c Compare August 11, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...) compiler no-pro-trigger Skip the devitopro submodule update on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants