Skip to content

compiler: move launch check injection to later in compilation pipeline#2903

Open
EdCaunt wants to merge 2 commits intomainfrom
fixup-check-launch
Open

compiler: move launch check injection to later in compilation pipeline#2903
EdCaunt wants to merge 2 commits intomainfrom
fixup-check-launch

Conversation

@EdCaunt
Copy link
Copy Markdown
Contributor

@EdCaunt EdCaunt commented Apr 24, 2026

Other half in PRO

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 18.18182% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.41%. Comparing base (ad2febe) to head (85603ea).

Files with missing lines Patch % Lines
devito/passes/iet/errors.py 18.18% 27 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2903      +/-   ##
==========================================
- Coverage   83.46%   83.41%   -0.05%     
==========================================
  Files         248      248              
  Lines       51570    51602      +32     
  Branches     4441     4447       +6     
==========================================
+ Hits        43045    43046       +1     
- Misses       7774     7804      +30     
- Partials      751      752       +1     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.74% <18.18%> (-0.05%) ⬇️
pytest-gpu-gcc- 78.04% <18.18%> (-0.04%) ⬇️
pytest-gpu-icx- 77.64% <18.18%> (-0.03%) ⬇️
pytest-gpu-nvc-nvidiaX 69.27% <18.18%> (-0.06%) ⬇️

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.


macro = [langbb['check-launch']]

_check_launch(graph, definition=definition, macro=macro, **kwargs)
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.

Not sure this needs to be split in three functions. And if so the def/macro should be in the actual iet pass and this should just check the option

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.

It doesn't need to be three functions, but it is more readable that way imo. The def/macro is the same across all IETs so I don't see why it would need to go inside the IET pass itself?

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.

I don't think it's more readable to split a pass this small into three functions that don't have any reuse

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an IET pass to inject a kernel-launch error check macro later in the compilation pipeline (gated by errctl), aiming to stop execution early when a device kernel launch fails.

Changes:

  • Added a new check_launch pass that wraps KernelLaunch nodes found under Iteration nodes with an additional “check launch” statement.
  • Added generation of a CHECK_LAUNCH macro definition (based on langbb error-peeking support) and returns it via the pass headers byproduct.
  • Exported check_launch from devito.passes.iet.errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread devito/passes/iet/errors.py
@EdCaunt EdCaunt force-pushed the fixup-check-launch branch from 9bfc00b to 85603ea Compare April 27, 2026 11: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.

3 participants