Skip to content

Conversation

@mloubout
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.01%. Comparing base (cbc2c6c) to head (b7aaf87).
Report is 4 commits behind head on master.

Files Patch % Lines
devito/passes/clusters/asynchrony.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2441   +/-   ##
=======================================
  Coverage   87.01%   87.01%           
=======================================
  Files         236      236           
  Lines       44900    44899    -1     
  Branches     8361     8360    -1     
=======================================
  Hits        39071    39071           
+ Misses       5100     5099    -1     
  Partials      729      729           

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

@mloubout mloubout force-pushed the async-bwd branch 6 times, most recently from ce9e1da to 24f8b31 Compare August 13, 2024 16:40
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.

Lgtm

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.

We'll need a test for this, ideally here in OSS (test_gpu_common::TestStreaming) or at worst in PRO would be fine too

fetch = e.rhs.indices[d]
if direction is Forward:
findex = fetch + 1
fshift = 1 if direction is Forward else -1
Copy link
Contributor

Choose a reason for hiding this comment

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

random thought: we should just set the direction values to -1, 0 (Any), 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah good point. 0 might lead to scheduling issues though

if direction is Forward:
findex = fetch + 1
fshift = 1 if direction is Forward else -1
if isinstance(fetch, IntDiv) or any(isinstance(a, IntDiv) for a in fetch.args):
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why we need this change.

Searching for IntDiv like that seems fragile to me. Also, either search(fetch, IntDiv) or fetch.find(IntDiv) should be a more compact and robust way of expressing what this line is trying to express

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you have fetch = IntDiv(time, factor) or some expression of it, then fetch._subs(pd, pd + fshift) will become IntDiv(time+1, factor) which basically does nothing because IntDiv(time, factor) = IntDiv(time+1, factor). Ideally would not want that if but rather find the time dimension in fetch then do a ._sub(t, t+t.spacing) but then need to do an extra {spacing: 1} afterwards too.
THis seemed simpler and less involved and I think covers 99% of the cases

@FabioLuporini
Copy link
Contributor

We'll need a test for this, ideally here in OSS (test_gpu_common::TestStreaming) or at worst in PRO would be fine too

sorry, there is indeed one in PRO. Sorry!

@mloubout mloubout merged commit 0e5be9a into master Aug 20, 2024
@mloubout mloubout deleted the async-bwd branch August 20, 2024 15:00
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