Skip to content

Sparse eq efunc lowering#2940

Draft
mloubout wants to merge 18 commits into
mainfrom
sparse-eq-efunc-lowering
Draft

Sparse eq efunc lowering#2940
mloubout wants to merge 18 commits into
mainfrom
sparse-eq-efunc-lowering

Conversation

@mloubout
Copy link
Copy Markdown
Contributor

Revamp interpolation

  • Keep a single "equation" for most of the lowering making it much simplere for the compiler and avoid issue with temporaries floating around
  • Lower as an efunc in iet at the end
  • FIxes an issue when interpolating from a buffered function (rec.interpolate(vsave)` with not equation

Testing CI

@mloubout mloubout added compiler API api (symbolics, types, ...) labels May 29, 2026
mloubout added 16 commits May 29, 2026 10:04
…sses

The 'kind' attribute and the 'kind == ...' / 'isinstance(eq, Inc)' branches
that gated interpolation vs. injection behaviour are replaced by leaf
classes (Interpolation, IncrInterpolation, Injection) sharing a small
InterpolationMixin / InjectionMixin. The polymorphic surface (efunc_prefix,
field, is_head_eq, sparse_temps) lives on the leaves, so the IET pass and
the lowering pipeline drop their kind-discriminating conditionals.
@mloubout mloubout force-pushed the sparse-eq-efunc-lowering branch from 6f2a15f to 0f1f9eb Compare May 29, 2026 14:08
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 61.89320% with 157 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.30%. Comparing base (347d2c7) to head (8fc3dc4).

Files with missing lines Patch % Lines
tests/test_interpolation.py 12.50% 63 Missing ⚠️
tests/test_dle.py 0.00% 33 Missing ⚠️
devito/passes/iet/sparse.py 79.16% 10 Missing and 10 partials ⚠️
tests/test_mpi.py 0.00% 14 Missing ⚠️
tests/test_caching.py 0.00% 8 Missing ⚠️
devito/operations/interpolators.py 88.70% 6 Missing and 1 partial ⚠️
tests/test_operator.py 0.00% 5 Missing ⚠️
devito/ir/equations/equation.py 94.11% 1 Missing and 2 partials ⚠️
devito/passes/clusters/buffering.py 0.00% 1 Missing and 1 partial ⚠️
devito/types/equation.py 97.91% 1 Missing ⚠️
... and 1 more

❗ There is a different number of reports uploaded between BASE (347d2c7) and HEAD (8fc3dc4). Click for more details.

HEAD has 16 uploads less than BASE
Flag BASE (347d2c7) HEAD (8fc3dc4)
18 8
pytest-gpu-gcc- 6 3
pytest-gpu-icx- 3 1
pytest-gpu-nvc-nvidiaX 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2940       +/-   ##
===========================================
- Coverage   83.38%   52.30%   -31.09%     
===========================================
  Files         248      249        +1     
  Lines       51960    52198      +238     
  Branches     4480     4509       +29     
===========================================
- Hits        43326    27301    -16025     
- Misses       7879    23916    +16037     
- Partials      755      981      +226     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.70% <84.85%> (+0.05%) ⬆️
pytest-gpu-gcc- 43.52% <58.98%> (-34.57%) ⬇️
pytest-gpu-icx- 43.27% <58.98%> (-34.74%) ⬇️
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 Sentry.
📢 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 added 2 commits May 29, 2026 11:39
Sparse-op lowering belongs at the IET-pass level alongside other
target-independent structural lowerings, not buried inside the MPI
pass. Lifting it also fixes a missed host-device transfer on GPU:
the position/coefficient temps it materialises read the coordinate
SubFunctions, but those reads were invisible to place_transfers
because Graph.data_movs was snapshotted before mpiize ran.

Graph.data_movs is now a property recomputed from the live efunc
set so downstream passes see ExprStmts introduced after Graph
construction.
After lifting lower_sparse_ops out of mpiize, an injection nest is
turned into a Call before optimize_halospots runs, so
_drop_reduction_halospots can no longer detect that the wrapping
HaloSpot's entry for the injected field is reduction-only. The stale
entry was left in place, and on save=True (no modulo buffering) the
hoist pass propagated the loop iteration variable out of the time
loop, producing an undeclared 'time' reference. Drop those entries at
lowering time so the resulting HaloSpot only carries entries with a
genuine read at the IET level.
@mloubout mloubout force-pushed the sparse-eq-efunc-lowering branch from 8fc3dc4 to 0c27438 Compare May 30, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...) compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant