-
Notifications
You must be signed in to change notification settings - Fork 49
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
Storage reduction pass #203
Conversation
This reverts commit 944bc5c.
Could this be changed to use the |
Thank you, I will look at using masks. |
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.
Getting there. Needs support for 1D fields and masks (eddie-c-davis#5)
src/gt4py/backend/debug_backend.py
Outdated
offset = "{:+d}".format(node.offset[ax]) if ax in node.offset else "" | ||
index.append("{ax}{offset}".format(ax=ax, offset=offset)) | ||
|
||
# Extend index with zeros... | ||
index.extend(["0"] * (len(self.block_info.extent) - len(index))) |
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.
This should use the filter_mask
or NumericTuple.from_mask
after merging.
for i in range(len(extent) - len(axes)): | ||
shape += ", 1" |
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.
Same here.
{%- endfor %} | ||
{% set arg_counter = arg_counter + arg_fields|length %} | ||
{% for param in parameters %} | ||
using p_{{ param.name }} = gt::arg<{{ arg_counter + loop.index0 }}, gt::global_parameter<{{ param.dtype }}>>; | ||
using p_{{ param.name }} = gt::arg<{{ arg_counter + loop.index0 }}, gt::global_parameter<backend_t, {{ param.dtype }}>>; |
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.
Is backend_t
is needed here? You may have gotten this at one point from one of my PRs, but I'm not sure it's really needed after all.
@@ -160,11 +183,12 @@ auto make_grid(const std::array<gt::uint_t, 3>& compute_domain_shape) { | |||
} | |||
|
|||
|
|||
{%- for axes in used_axes %} | |||
{%- if axes.name == "ijk" %} |
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.
1D field support here.
Replaced with temp-storage-reduce branch so closing. |
Description
This PR introduces an optimization pass that reduces three dimensional temporary storages (IJK) to two dimensions (IJ) whenever possible.