Skip to content

[SYCL-MLIR]: Remove mlir inlining pass #7536

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

Merged
merged 5 commits into from
Nov 25, 2022

Conversation

etiotto
Copy link

@etiotto etiotto commented Nov 24, 2022

cgeist uses the stock MLIR inlining pass in its pass pipeline. The MLIR inlining pass has no heuristic and is essentially a greedy inliner, that is, as long as callees do not contain any operation deemed illegal for inlining by their dialects, it inlines all callees irrespective of any cost considerations (size, hotness, etc...).

Without a proper cost model, the MLIR inlining pass is not useful to our use case. This PR removes the inlining pass from the cgeist mlir pass pipeline and adjust test cases accordingly.

Signed-off-by: Tiotto, Ettore <ettore.tiotto@intel.com>
@etiotto etiotto added the sycl-mlir Pull requests or issues for sycl-mlir branch label Nov 24, 2022
@etiotto etiotto self-assigned this Nov 24, 2022
@etiotto
Copy link
Author

etiotto commented Nov 24, 2022

Note: I am working on a proper inlining pass. I plan to add an 'always inliner' pass to inline callees that have the 'alwaysinline' function attribute (now that we have the ability to annotate mlir functions with attributes). Subsequently I will work on a SCC inliner with a proper set of heuristcs. At that point we can adjust the cgeist tests to account for inlined callees.

Co-authored-by: Whitney Tsang <54643204+whitneywhtsang@users.noreply.github.com>
@etiotto
Copy link
Author

etiotto commented Nov 24, 2022

@whitneywhtsang anything preventing you to approve this PR ?

Co-authored-by: Whitney Tsang <54643204+whitneywhtsang@users.noreply.github.com>
Co-authored-by: Whitney Tsang <54643204+whitneywhtsang@users.noreply.github.com>
Signed-off-by: Tiotto, Ettore <ettore.tiotto@intel.com>
@etiotto etiotto merged commit 9a2faf2 into intel:sycl-mlir Nov 25, 2022
@etiotto etiotto deleted the remove_inlining_pass branch November 25, 2022 14:19
etiotto added a commit that referenced this pull request Nov 28, 2022
PR #7536 removed the MLIR inlining
pass (too greedy). This PR introduces an 'always-inline' pass in the
`cgeist` MLIR pipeline. This pass inlines only `sycl.call` call sites
with callee that has the 'alwaysinline' mlir function attribute.

The pass uses a generic SCC inliner to perform its actions and
specializes the inlining heuristic used at outline above.

Signed-off-by: Tiotto, Ettore <ettore.tiotto@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sycl-mlir Pull requests or issues for sycl-mlir branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants