New transformation: ReplaceKernels#692
Open
MichaelSt98 wants to merge 1 commit into
Open
Conversation
… with alternative routines. Conceptually, the transformation walks each call site in the processed routine, looks for names listed in ``replace_kernels_map``, resolves the replacement routine, and reconstructs the actual argument list against the replacement signature. When the original call target is unresolved in the IR, the transformation also tries to resolve the original routine from source so that remapping can still be done against the original dummy argument names instead of the raw actual expressions. Once the replacement call has been rebuilt, the transformation updates imports/includes to match the new callee and optionally marks the replacement routine as blocked for further scheduler traversal.
|
Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/692/index.html |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #692 +/- ##
==========================================
- Coverage 94.19% 94.18% -0.02%
==========================================
Files 288 290 +2
Lines 47496 47997 +501
==========================================
+ Hits 44741 45204 +463
- Misses 2755 2793 +38
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace configured kernel calls with alternative routines.
Conceptually, the transformation walks each call site in the processed routine, looks for names listed in
replace_kernels_map, resolves the replacement routine, and reconstructs the actual argument list against the replacement signature. When the original call target is unresolved in the IR, the transformation also tries to resolve the original routine from source so that remapping can still be done against the original dummy argument names instead of the raw actual expressions. Once the replacement call has been rebuilt, the transformation updates imports/includes to match the new callee and optionally marks the replacement routine as blocked for further scheduler traversal.Description
This pull request introduces comprehensive tests for the new
ReplaceKernelstransformation and ensures it is imported as part of the main transformation package. The main focus is on verifying the correct remapping of kernel routine arguments, handling of optional arguments, import rewriting, plan generation, and pipeline integration.Testing and Validation of
ReplaceKernelsTransformationNew test suite for kernel replacement:
test_replace_kernel.pycontaining multiple tests that cover argument remapping, handling of optional arguments, include/import rewriting, plan output, and integration in a pipeline. This ensures theReplaceKernelstransformation works as expected across a variety of scenarios.Integration with transformation package:
replace_kerneltransformation in the mainloki.transformationspackage by importing it in__init__.py, making it available for general use.Contributor Declaration
By opening this pull request, I affirm the following: