Skip to content

Promote iree-opt-data-tiling to pipeline options.#22295

Merged
hanhanW merged 2 commits intoiree-org:mainfrom
hanhanW:data-tiling-opt
Oct 14, 2025
Merged

Promote iree-opt-data-tiling to pipeline options.#22295
hanhanW merged 2 commits intoiree-org:mainfrom
hanhanW:data-tiling-opt

Conversation

@hanhanW
Copy link
Contributor

@hanhanW hanhanW commented Oct 13, 2025

There are two paths for data-tiling. One starts from global optimization phase and the other starts from dispatch creation phase. The former one is the suggested path, since the latter one is just getting used recently.

The revision adds a new iree-global-opt-data-tiling flag that allows users to explicitly start the data-tiling from global optimization phase; it promotes the existing flag to an umbrella flag for data-tiling, so users can start data-tiling with the suggested path. It is intended to be NFC for most users in terms of command line flags. The iree-opt-data-tiling used to be identical to the new iree-global-opt-data-tiling, and it selects the global optimization path when it is set.

Note that the pipeline flag has higher priority. I.e., it overrides the other two flags if it is set as true.

Doc preview: https://hanhanw.github.io/iree/reference/optimization-options/#data-tiling-iree-opt-data-tiling-off

There are two paths for data-tiling. One starts from global optimization
phase and the other starts from dispatch creation phase. The former one
is the suggested path, since the latter one is just getting used
recently.

The revision adds an umbrella flag for data-tiling, so users can start
data-tiling with the suggested path. It is intended to be NFC for most
users in terms of command line flags.

The revision also adds a new `iree-global-opt-data-tiling` flag that
allows users to explicitly start the data-tiling from global
optimization phase.

Note that the pipeline flag has higher priority. I.e., it overrides the
other two flags if it is set as true.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
Comment on lines +37 to +40
"you have a preference. See `iree-global-opt-data-tiling` and "
"`iree-dispatch-creation-data-tiling` for details. Note that this "
"flag will override the other two flags, because it has a higher "
"priority."),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking if we should use the website doc instead, but it may be inconsistent for old binaries. A better improvement may be embedding the information in their flag descriptions.

@hanhanW
Copy link
Contributor Author

hanhanW commented Oct 13, 2025

cc @egebeysel @NoumanAmir657 @banach-space @rednoah91 @JerryShih @Max191 @bjacob @jtuyls @Yu-Zhewen @Abhishek-Varma

Copy link
Contributor

@jtuyls jtuyls left a comment

Choose a reason for hiding this comment

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

LGTM, nice!

Copy link
Contributor

@Max191 Max191 left a comment

Choose a reason for hiding this comment

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

Nice improvement to the docs!

Copy link
Contributor

@IanWood1 IanWood1 left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +320 to +323
if (dispatchTransformOptions.dataTiling) {
assert(!globalOptimizationOptions.dataTiling &&
"expect only one data-tiling option to be enabled");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be triggered by the user by passing iree-global-opt-data-tiling and iree-dispatch-creation-data-tiling at the same time right? So this seems like something that should still error/warn in NDEBUG. Maybe llvm::reportFatalUsageError or similar would be good here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I use llvm::report_fatal_error and make it fall back to one of options.

"flag will override the other two flags, because it has a higher "
"priority."),
llvm::cl::cat(category));

Copy link
Contributor

Choose a reason for hiding this comment

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

Side note: If we get more flags that control the options of multiple passes it might be worth setting up something similar to iree-opt-level to make it more declarative & so that the logic is in Options.cpp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think data-tiling flag is in a similar scope of iree-opt-level, or a sub-option in the future. Data-tiling does not belong to any opt level at the moment, because it can regress backends that don't implement data-tiling a lot. It is not ready for the opt level scope yet, but ideally we'd enable it for O2 in the future.

It is in a similar scope to me because it is an umbrella flag that controls encoding early materialization, propagation, etc.

I don't follow how it makes the logic be in Options.cpp, though.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
@hanhanW hanhanW merged commit d909d36 into iree-org:main Oct 14, 2025
39 of 45 checks passed
@hanhanW hanhanW deleted the data-tiling-opt branch October 14, 2025 21:11
weidel-p pushed a commit to weidel-p/iree that referenced this pull request Oct 21, 2025
There are two paths for data-tiling. One starts from global optimization
phase and the other starts from dispatch creation phase. The former one
is the suggested path, since the latter one is just getting used
recently.

The revision adds a new `iree-global-opt-data-tiling` flag that allows
users to explicitly start the data-tiling from global optimization
phase; it promotes the existing flag to an umbrella flag for
data-tiling, so users can start data-tiling with the suggested path. It
is intended to be NFC for most users in terms of command line flags. The
`iree-opt-data-tiling` used to be identical to the new
`iree-global-opt-data-tiling`, and it selects the global optimization
path when it is set.

Note that the pipeline flag has higher priority. I.e., it overrides the
other two flags if it is set as true.

Doc preview:
https://hanhanw.github.io/iree/reference/optimization-options/#data-tiling-iree-opt-data-tiling-off

---------

Signed-off-by: hanhanW <hanhan0912@gmail.com>
Signed-off-by: Philipp <philipp.weidel@intel.com>
pstarkcdpr pushed a commit to pstarkcdpr/iree that referenced this pull request Nov 28, 2025
There are two paths for data-tiling. One starts from global optimization
phase and the other starts from dispatch creation phase. The former one
is the suggested path, since the latter one is just getting used
recently.

The revision adds a new `iree-global-opt-data-tiling` flag that allows
users to explicitly start the data-tiling from global optimization
phase; it promotes the existing flag to an umbrella flag for
data-tiling, so users can start data-tiling with the suggested path. It
is intended to be NFC for most users in terms of command line flags. The
`iree-opt-data-tiling` used to be identical to the new
`iree-global-opt-data-tiling`, and it selects the global optimization
path when it is set.

Note that the pipeline flag has higher priority. I.e., it overrides the
other two flags if it is set as true.

Doc preview:
https://hanhanw.github.io/iree/reference/optimization-options/#data-tiling-iree-opt-data-tiling-off

---------

Signed-off-by: hanhanW <hanhan0912@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants