Skip to content

compiler: Revamp fuse-task optoption#2975

Open
FabioLuporini wants to merge 11 commits into
mainfrom
fuse-tasks-groups
Open

compiler: Revamp fuse-task optoption#2975
FabioLuporini wants to merge 11 commits into
mainfrom
fuse-tasks-groups

Conversation

@FabioLuporini

Copy link
Copy Markdown
Contributor

I'm also renaming it into what it should always have been in the first place -- 'npthreads'. This is an undocumented option anyway and no-one is using it, so I think it's perfectly safe

More tests in PRO

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.28099% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.58%. Comparing base (78741f4) to head (30041af).

Files with missing lines Patch % Lines
devito/passes/iet/orchestration.py 95.03% 4 Missing and 3 partials ⚠️
devito/passes/clusters/buffering.py 93.93% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2975      +/-   ##
==========================================
+ Coverage   83.53%   83.58%   +0.05%     
==========================================
  Files         257      257              
  Lines       53601    53783     +182     
  Branches     4586     4608      +22     
==========================================
+ Hits        44775    44955     +180     
  Misses       8032     8032              
- Partials      794      796       +2     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.54% <93.38%> (+0.14%) ⬆️
pytest-gpu-gcc- 78.20% <28.09%> (-0.20%) ⬇️
pytest-gpu-icx- 78.12% <28.09%> (-0.20%) ⬇️
pytest-gpu-nvc-nvidiaX 69.18% <93.38%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks sane, probably gonna make #2850 a pain

Comment thread devito/core/cpu.py
Comment thread devito/passes/clusters/asynchrony.py Outdated
return None

gid, = gids
return gid

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just return gids.pop()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes

Comment thread devito/core/cpu.py
Comment thread devito/ir/iet/nodes.py Outdated
Comment on lines +1562 to +1563
optype, = {type(op) for spot in self.sync_spots
for op in spot.sync_ops}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should probably have some kind of error handling or at least an assert for the case there are mixed types here (and the set is not length-1), otherwise it's potentially going to lead to cryptic errors or even silent errors if the ValueError gets ingested by a try-except

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes

Comment thread devito/ir/support/syncs.py
Comment thread devito/passes/iet/orchestration.py Outdated
body=Conditional(task.condition.condition,
task.spot.body))
for task in tasks]
insertions[tasks[-1].anchor].append(SyncSpotRegion(spots))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick: pulling out tasks[-1].anchor and assigning a descriptive variable name would improve readability here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is changed already, I knew I may still have had to tweak a couple of things, including this one

Comment thread devito/passes/iet/orchestration.py Outdated
return iet, [efunc]
layers = {infer_layer(i.function) for i in sync_ops}
if len(layers) != 1:
raise CompilationError("Unsupported streaming case")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick: worth adding why to the error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

those 4 lines also appear in another place, so I'll move them into a utility function and improve the error message as per your suggestion

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.

3 participants