-
Notifications
You must be signed in to change notification settings - Fork 16
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
Parameter Study Transform #532
base: main
Are you sure you want to change the base?
Conversation
…ed in it. Not the axis as well.
…n the variable even if it is not initially subscripted.
…ted programming constructs.
@inducer This is ready for the first round of review. |
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.
Some thoughts from a first scroll.
pytato/transform/parameter_study.py
Outdated
|
||
# {{{ Operations with multiple predecessors. | ||
|
||
def _mult_pred_same_shape(self, expr: Stack | Concatenate) -> tuple[ArraysT, |
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 think of a better name for this.
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.
Updated to _broadcast_predecessors_to_same_shape
…the original array.
Co-authored-by: Andreas Klöckner <[email protected]>
same study then you need to have the same type of | ||
:class:`ParameterStudyAxisTag`. | ||
""" | ||
size: int |
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 information is already contained in the length of the tagged axis (via the array's shape), so I feel like having this would be redundant.
pytato/transform/parameter_study.py
Outdated
|
||
StudiesT = tuple[ParameterStudyAxisTag, ...] | ||
ArraysT = tuple[Array, ...] | ||
KnownShapeType = tuple[IntegralT, ...] |
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.
Should use same type as Array.shape
. I see no issue with parametric axis lengths for non-study axes.
pytato/transform/parameter_study.py
Outdated
and so the shape of :math:`\mathbf{Z}` will be | ||
(:math:`\mathbf{orig\_shape}`, :math:`\mathbf{S1}.size`, :math:`\mathbf{S2}.size`). | ||
|
||
A parameter study is specified in an array by tagging the corresponding axis |
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.
You get this far in before saying what a parameter study is? 🤔
|
||
study_to_arrays: dict[frozenset[ParameterStudyAxisTag], ArraysT] = {} | ||
|
||
active_studies: set[ParameterStudyAxisTag] = set() |
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.
Set comprehension?
Creates a mapper to expand a single instance DAG into a multiple independent instance DAG.