Skip to content
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

compiler: Avoid allocating Bundles on the host if transient #2503

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

FabioLuporini
Copy link
Contributor

Impacted test tweaked in PRO

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 7.50000% with 37 lines in your changes missing coverage. Please review.

Project coverage is 87.29%. Comparing base (5a15896) to head (93e4323).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
devito/passes/iet/definitions.py 7.50% 36 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2503      +/-   ##
==========================================
- Coverage   87.35%   87.29%   -0.07%     
==========================================
  Files         238      238              
  Lines       45574    45609      +35     
  Branches     4035     4042       +7     
==========================================
+ Hits        39813    39814       +1     
- Misses       5079     5112      +33     
- Partials      682      683       +1     

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

@@ -214,6 +216,38 @@ def _alloc_mapped_array_on_high_bw_mem(self, site, obj, storage, *args):

storage.update(obj, site, allocs=alloc, frees=free, efuncs=(efunc0, efunc1))

def _alloc_bundle_struct_on_high_bw_mem(self, site, obj, storage):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: some comments would help reduce the bus factor of this code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, if it turns green I will add it to the to-be-rebased #2500

elif i.is_LocalObject:
self._alloc_object_on_low_lat_mem(iet, i, storage)
elif i.is_Array or i.is_Bundle:

elif i.is_Bundle:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way to reduce the "death by conditionals" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After spending a couple of hours on this very matter this morning, I'm inclined to say that it's pretty challenging to come up with one. The problem is that there's a combinatorial explosion of possibilities (luckily with small exponent), and all those ifs implement such space

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose it's all attributes too, which makes it even more challenging without obfuscating what's going on

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 the implicit question was "can you use singledispatch", yeah, you got it right

@FabioLuporini FabioLuporini merged commit cc04242 into master Dec 20, 2024
31 checks passed
@FabioLuporini FabioLuporini deleted the patch-beta2-is-transient branch December 20, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants