-
Notifications
You must be signed in to change notification settings - Fork 62
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
transform: stencil to csl - generate layout module #2720
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2720 +/- ##
==========================================
+ Coverage 89.91% 89.97% +0.05%
==========================================
Files 367 368 +1
Lines 47302 47440 +138
Branches 7229 7245 +16
==========================================
+ Hits 42533 42684 +151
+ Misses 3658 3644 -14
- Partials 1111 1112 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments and docstrings to this PR, it's really hard to follow what you are doing / want to do because of the distinct lack of comments.
ctx.add_params_to_program( | ||
ParamOp.get("stencil_comms_params", ComptimeStructType()), | ||
ParamOp.get("memcpy_params", ComptimeStructType()), | ||
ParamOp.get("z_dim", IntegerType(16, Signedness.SIGNED)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend not using signedness unless you really need an unsigned integer!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito for all other integer variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd proceed with caution on this - most of what is happening here is setting up module (library) imports, calling module functions, and using that to set params for the pe.csl
. It might just be harder to reverse-engineer it in the printer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the point of view of the printer using signed or signless is exactly the same (they both get printed as signed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might need to look into that, some functions have specific requirements and may only accept one of the two
Added comments and doc strings as suggested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great start, but I am not sure if the way we integrate this is the right path right now. I would prefer to have something closer to how GPU dialect does offloading.
I think that would result in much more usable passes and would make our life significantly easier.
I think we need a mid-level intermediate dialect for that though.
xdsl/dialects/csl.py
Outdated
@@ -1486,6 +1538,14 @@ class ParamOp(IRDLOperation): | |||
|
|||
res = result_def(T) | |||
|
|||
@staticmethod | |||
def get(name: str, result_type: T) -> ParamOp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T
is not a valid type here, I think? @PapyChacal
This PR doesn't actually do very much except initialising a layout module and a stub program module that takes care of some administrative tasks such as importing things and initialising the stencil comms library. I'm hoping this should in theory be non-committal as to how we go about further translating. |
Adding constructors for many CSL ops. This was originally part of #2720 --------- Co-authored-by: n-io <n-io@users.noreply.github.com>
We expect that we will need to generate csl modules very soon and are benching this PR until then. |
Adding a transform from stencil to CSL.
stencil.apply
ops to figure out stencil pattern and compute grid size (done)