-
Notifications
You must be signed in to change notification settings - Fork 243
misc: Miscellaneous corner cases fixes #2730
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
Conversation
There was a problem hiding this 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"
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f560923 to
ade9ad9
Compare
67ca8d1 to
f25095c
Compare
3bc81fc to
b979285
Compare
devito/passes/clusters/buffering.py
Outdated
| if len(ispaces) > 1: | ||
| raise CompilationError("Unsupported `buffering` over different " | ||
| "IterationSpaces") | ||
| ispaces = {i.insert(self.dim, self.bdims).reorder() for i in ispaces} |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comm
14060ae to
fa92d42
Compare
devito/passes/clusters/buffering.py
Outdated
| # 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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
23a609e to
445a783
Compare
| 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)}" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
devito/passes/iet/languages/utils.py
Outdated
| 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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "slip" -> "skip"
Corner cases triggered in pro by fft