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

transformations: (csl-stencil-to-csl-wrapper) Translate func args to exportable memref.global #3051

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

n-io
Copy link
Collaborator

@n-io n-io commented Aug 16, 2024

Top-level func args are no longer set up as block args in the newly created program module, but are instead translated to (exportable) memref.global ops.

@n-io n-io added the transformations Changes or adds a transformatio label Aug 16, 2024
@n-io n-io requested review from AntonLydike and dk949 August 16, 2024 15:35
@n-io n-io self-assigned this Aug 16, 2024
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.87%. Comparing base (4423038) to head (221d403).
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3051    +/-   ##
========================================
  Coverage   89.86%   89.87%            
========================================
  Files         415      416     +1     
  Lines       52078    52441   +363     
  Branches     8048     8115    +67     
========================================
+ Hits        46799    47130   +331     
- Misses       3984     4006    +22     
- Partials     1295     1305    +10     

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

Comment on lines +63 to +64
// CHECK-NEXT: %35 = memref.get_global @a : memref<512xf32>
// CHECK-NEXT: %a = builtin.unrealized_conversion_cast %35 : memref<512xf32> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't quite follow how this unrealized_conversion_cast gets passed to the stencil.load below. Is that done with the arg_op_mapping?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any stencil.load should be resolved by --stencil-bufferize and not be there at this stage, and everything should be based on stencil.field<AxBxtensor<Cxf32>>. This in turn is translated to a memref in --csl-stencil-bufferize, which takes the element_type (tensor) and translates it to a memref. Maybe it should translate to memref<1x1xCxf32> instead of memref<Cxf32>, but this is all linked to DMP which has changes in the pipeline that allow it to operate on stencil.field, so it's best to wait for this to be merged.

@n-io n-io merged commit f591b3b into main Aug 19, 2024
9 checks passed
@n-io n-io deleted the nicolai/csl-lowering-func-args branch August 19, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
transformations Changes or adds a transformatio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants