Skip to content

Commit

Permalink
fix[next]: Disable collapse tuple if propagation (GridTools#1454)
Browse files Browse the repository at this point in the history
We observed some increase in compile time due to the `PROPAGATE_TO_IF_ON_TUPLES` option of the `CollapseTuple` pass. This option is needed for `if` statements to work properly, which is not fully functional yet anyway and will be taken care of separately. We disable the option for now until GridTools#1414 is merged.
  • Loading branch information
tehrengruber authored Feb 16, 2024
1 parent 077c786 commit d31d2cf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gt4py/next/iterator/transforms/pass_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def apply_common_transforms(
inlined,
# to limit number of times global type inference is executed, only in the last iterations.
use_global_type_inference=inlined == ir,
# TODO(tehrengruber): disabled since it increases compile-time too much right now
flags=~CollapseTuple.Flag.PROPAGATE_TO_IF_ON_TUPLES,
)
# This pass is required such that a deref outside of a
# `tuple_get(make_tuple(let(...), ...))` call is propagated into the let after the
Expand Down Expand Up @@ -159,7 +161,12 @@ def apply_common_transforms(
# larger than the number of closure outputs as given by the unconditional collapse, we can
# only run the unconditional version here instead of in the loop above.
if unconditionally_collapse_tuples:
ir = CollapseTuple.apply(ir, ignore_tuple_size=unconditionally_collapse_tuples)
ir = CollapseTuple.apply(
ir,
ignore_tuple_size=unconditionally_collapse_tuples,
# TODO(tehrengruber): disabled since it increases compile-time too much right now
flags=~CollapseTuple.Flag.PROPAGATE_TO_IF_ON_TUPLES,
)

if lift_mode == LiftMode.FORCE_INLINE:
ir = _inline_into_scan(ir)
Expand Down

0 comments on commit d31d2cf

Please sign in to comment.