Skip to content

[SYCL][Fusion] Add kernel fusion extension API #7416

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 3 commits into from
Nov 24, 2022

Conversation

sommerlukas
Copy link
Contributor

This is the first patch in a series of patches to add an implementation of the kernel fusion extension. We have split the implementation into multiple patches to make them more easy to review.

This first patch introduces the user-facing API discussed in the extension proposal. It does not yet add any fusion functionality, just the mere API and SYCL properties. Calls to the API will throw an error until the remaining functionality lands with the following patches.

The design document for the overall implementation of kernel fusion can be found here.

Signed-off-by: Lukas Sommer [email protected]

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

Could you please add some tests for this? I realize there isn't much functionality to it as of this part, but it would be good to at least have some tests that ensures that simple programs using them will compile.

@@ -144,6 +144,9 @@ install(DIRECTORY ${OpenCL_INCLUDE_DIR}/CL
DESTINATION ${SYCL_INCLUDE_DIR}/sycl
COMPONENT OpenCL-Headers)

# Option to enable online kernel fusion via a JIT compiler
option(SYCL_ENABLE_KERNEL_FUSION "Enable kernel fusion via JIT compiler" OFF)
Copy link
Contributor

Choose a reason for hiding this comment

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

@pvchupin - Do we have a good place to document this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A future PR will add support for fusion in buildbot/configure.py, which would then set the value for this option.

Users using buildbot/configure.py would therefore not need to set this option manually.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, I am okay with waiting with documentation for it until it has an option in buildbot/configure.py. I'll let @pvchupin have the last say in that though.

@sommerlukas
Copy link
Contributor Author

sommerlukas commented Nov 22, 2022

Thank you for your feedback @steffenlarsen!

I've added two simple tests compiling applications using the kernel fusion API in intel/llvm-test-suite#1404.

The tests do not yet execute the compiled application, as the necessary functionality is still missing, but it checks that compilation will work with the kernel fusion API.

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

LGTM! As mentioned in the comment, I am okay with having the kernel_funsion_impl class in a follow-up patch.

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀

@sommerlukas
Copy link
Contributor Author

Thanks for the approval @steffenlarsen. Can you or @pvchupin please merge this PR, I do not have the necessary permissions to merge.

@steffenlarsen steffenlarsen merged commit 216137b into intel:sycl Nov 24, 2022
steffenlarsen pushed a commit to intel/llvm-test-suite that referenced this pull request Nov 28, 2022
Two simple tests to check that code using the kernel fusion extension API compiles correctly. 

The tests currently do not yet execute the compiled application, as the necessary functionality will only be added to the implementation in a later PR. 

Spec: intel/llvm#7098
Implementation: intel/llvm#7416

Signed-off-by: Lukas Sommer <[email protected]>
pvchupin pushed a commit that referenced this pull request Dec 5, 2022
This is the second patch in a series of patches to add an implementation of thekernel fusion extension. We have split the implementation into multiple patches to make them more easy to review.

This patch can be reviewed and merged independently of #7416.

This patch adds the first components for the JIT compiler used for implementation of kernel fusion at runtime , concretely:

API definitions
Input translation from SPIR-V to LLVM IR
Insertion of fused kernel function stub and metadata
Supporting infrastructure such as compiler options.
CMake logic to link and code to invoke this JIT from the SYCL runtime will follow in a later patch.

Co-authored-by: Lukas Sommer [email protected]
Co-authored-by: Victor Perez [email protected]
Signed-off-by: Lukas Sommer [email protected]
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Feb 23, 2023
Two simple tests to check that code using the kernel fusion extension API compiles correctly. 

The tests currently do not yet execute the compiled application, as the necessary functionality will only be added to the implementation in a later PR. 

Spec: intel#7098
Implementation: intel#7416

Signed-off-by: Lukas Sommer <[email protected]>
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
…ite#1404)

Two simple tests to check that code using the kernel fusion extension API compiles correctly. 

The tests currently do not yet execute the compiled application, as the necessary functionality will only be added to the implementation in a later PR. 

Spec: intel#7098
Implementation: intel#7416

Signed-off-by: Lukas Sommer <[email protected]>
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.

3 participants