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

(dialects): adding csl_wrapper dialect #2867

Merged
merged 17 commits into from
Jul 11, 2024
Merged

(dialects): adding csl_wrapper dialect #2867

merged 17 commits into from
Jul 11, 2024

Conversation

n-io
Copy link
Collaborator

@n-io n-io commented Jul 8, 2024

The csl_wrapper dialect is helps initialise CSL modules and manage params.

  • Properties of the csl_wrapper.module are passed as BlockArgs to both layout_module and program_module
  • The layout module takes %x and %y BlockArgs, as well as all properties. The layout module offers various simplifications:
    • The terminating csl_wrapper.yield op is lowered to @set_tile_code. Any values yielded are passed as BlockArgs to the program module
    • Any operation using %x or %y will automatically be placed at the correct level of nesting for the generated @set_tile_code loop
    • Structs do not need to be handled manually at this stage and should be constructed automatically when lowering. At this level, we can simply provide a list of field names and args to yield.
    • The csl_wrapper.import_module op and yield can both take field names directly, without the need to handle structs at this level (the former exists solely for this purpose)
  • The program module's BlockArgs are all csl_wrapper.module properties as well as every field yielded by layout's yield op.
  • The semantics of properties-as-BlockArgs should hopefully keep program parameters nicely organised - i.e.., that we don't end up with separate, diverging copies of anything. This should make it really straightforward to manage program-wide properties before further lowering.

@n-io n-io added the dialects Changes on the dialects label Jul 8, 2024
@n-io n-io requested review from AntonLydike and dk949 July 8, 2024 16:20
@n-io n-io self-assigned this Jul 8, 2024
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.85%. Comparing base (9e2bf03) to head (034993d).
Report is 35 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2867    +/-   ##
========================================
  Coverage   89.85%   89.85%            
========================================
  Files         397      399     +2     
  Lines       49447    50171   +724     
  Branches     7607     7755   +148     
========================================
+ Hits        44430    45083   +653     
- Misses       3824     3860    +36     
- Partials     1193     1228    +35     

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

Copy link
Collaborator

@AntonLydike AntonLydike left a comment

Choose a reason for hiding this comment

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

This is a great direction to go in, I'm just not 100% on board with the current execution of it.

tests/filecheck/dialects/csl/csl-wrapper-ops.mlir Outdated Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@AntonLydike AntonLydike left a comment

Choose a reason for hiding this comment

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

Nicely done! Just one minor nitpick!

tests/dialects/test_csl_wrapper.py Outdated Show resolved Hide resolved
@n-io n-io merged commit 9f4a53b into main Jul 11, 2024
10 checks passed
@n-io n-io deleted the nicolai/csl-wrapper-dialect branch July 11, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants