Skip to content

Conversation

@mloubout
Copy link
Contributor

@mloubout mloubout commented Sep 8, 2025

Corner cases triggered in pro by fft

Copy link
Contributor

@EdCaunt EdCaunt left a comment

Choose a reason for hiding this comment

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

All seems reasonable. Typo in PR name "miscelanous" -> "miscellaneous"

@EdCaunt EdCaunt changed the title misc: miscelanous corner cases fixes misc: miscellaneous corner cases fixes Sep 8, 2025
@mloubout mloubout changed the title misc: miscellaneous corner cases fixes misc: Miscellaneous corner cases fixes Sep 8, 2025
@codecov
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 86.66667% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.07%. Comparing base (379c77d) to head (edeb3b6).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
devito/passes/iet/languages/utils.py 66.66% 5 Missing and 1 partial ⚠️
devito/passes/clusters/buffering.py 82.60% 2 Missing and 2 partials ⚠️
tests/test_dtypes.py 90.90% 3 Missing and 1 partial ⚠️
devito/passes/iet/linearization.py 66.66% 3 Missing ⚠️
devito/mpi/routines.py 0.00% 2 Missing ⚠️
devito/arch/archinfo.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2730      +/-   ##
==========================================
+ Coverage   83.03%   83.07%   +0.03%     
==========================================
  Files         248      248              
  Lines       50499    50623     +124     
  Branches     4440     4460      +20     
==========================================
+ Hits        41930    42053     +123     
- Misses       7807     7808       +1     
  Partials      762      762              
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.69% <57.54%> (-0.05%) ⬇️
pytest-gpu-nvc-nvidiaX 69.20% <56.60%> (-0.07%) ⬇️

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 mloubout force-pushed the locarray branch 10 times, most recently from f560923 to ade9ad9 Compare September 17, 2025 19:15
@mloubout mloubout force-pushed the locarray branch 3 times, most recently from 67ca8d1 to f25095c Compare September 29, 2025 13:52
@mloubout mloubout force-pushed the locarray branch 8 times, most recently from 3bc81fc to b979285 Compare October 6, 2025 18:33
if len(ispaces) > 1:
raise CompilationError("Unsupported `buffering` over different "
"IterationSpaces")
ispaces = {i.insert(self.dim, self.bdims).reorder() for i in ispaces}
Copy link
Contributor

Choose a reason for hiding this comment

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

this now really seems the same thing that you do above...

IDK, I need to look at this in the morning when I'm fresh, but there's a few things that I still don't understand

for example the one I just wrote above
and also why you need .reorder()

Copy link
Contributor

@FabioLuporini FabioLuporini left a comment

Choose a reason for hiding this comment

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

comm

@mloubout mloubout force-pushed the locarray branch 4 times, most recently from 14060ae to fa92d42 Compare October 21, 2025 13:41
# using it in an expression, such as HaloTouch Clusters
def key(c):
bufferdim = any(i in c.ispace.dimensions for i in self.bdims)
timeonly = all(d.is_Time for d in c.ispace.dimensions)
Copy link
Contributor

Choose a reason for hiding this comment

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

we cannot use is_Time

Copy link
Contributor

Choose a reason for hiding this comment

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

and why is this necessary now?

"""


def split_pointer(i, idx):
Copy link
Contributor

Choose a reason for hiding this comment

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

A short comment would help

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the comment is below in the atomic

@mloubout mloubout force-pushed the locarray branch 8 times, most recently from 23a609e to 445a783 Compare October 23, 2025 16:30
def _print_IndexedPointer(self, expr):
return f"{expr.base}{''.join(f'[{self._print(i)}]' for i in expr.index)}"
base = self._print(expr.base)
return f"{base}{''.join(f'[{self._print(i)}]' for i in expr.index)}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Can we split this into two lines? The nested fstring is not super easy to read imo

from devito.passes.iet.languages.utils import joins
from devito.passes.iet.languages.C import CBB
from devito.passes.iet.languages.CXX import CXXBB
from devito.passes.iet.languages.C import CBB, atomic_add as c_atomic_add
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth attaching the C/CXX atomic add functions to their corresponding BB classes to avoid this?

Copy link
Contributor Author

@mloubout mloubout Oct 27, 2025

Choose a reason for hiding this comment

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

It is attached to their BB, this is the parprgama that need to call it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no need for atomic without OMP so it should be set here

and np.issubdtype(rhs.dtype, np.complexfloating)):
# Complex i, complex j
# Atomic add real and imaginary parts separately
lhsr, rhsr = real(lhs), Real(rhs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Lowercase real() and imag() get redefined lower in the function - maybe this wants tweaking? I assume the different real and imag functions for the LHS and RHS are because the expressions Real/Imag get lowered to cannot be assigned to?

lhs, rhs = i.expr.lhs, i.expr.rhs
if (np.issubdtype(lhs.dtype, np.complexfloating)
and np.issubdtype(rhs.dtype, np.complexfloating)):
# Complex i, complex j
Copy link
Contributor

Choose a reason for hiding this comment

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

Ultra nitpick: j is never defined in these comments


@skipif(['noomp', 'device'])
@pytest.mark.parametrize('dtypeu', [np.float32, np.complex64, np.complex128])
def test_complex_reduction(dtypeu: np.dtype[np.complexfloating]) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

On a similar note, do we explicitly test complex interpolation/injection terms anywhere? I think we have a simple one for complex injection with CUDA, but doesn't look like we have a more general one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well this tests injection. Interpolation are just standard add/mul so there isn't any blocker, this is problematic because of the atomic

not get_advisor_path()):
skipit = "Only `icx+advisor` should be tested here"
break
# Slip if not using openmp
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "slip" -> "skip"

@mloubout mloubout merged commit 876310b into main Oct 31, 2025
62 of 65 checks passed
@mloubout mloubout deleted the locarray branch October 31, 2025 14:17
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.

5 participants