-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL][Fusion] Interface with kernel fusion JIT #7831
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
[SYCL][Fusion] Interface with kernel fusion JIT #7831
Conversation
The corresponding additions of tests to the LLVM test-suite are currently still a draft PR: sommerlukas/llvm-test-suite#1, because they are blocked by intel/llvm-test-suite#1416, which still requires reviews. |
86d9cb2
to
0b42d32
Compare
I also tried adding a unit test for the Unfortunately, it was not possible to test this as an unit test. To completely test the route using However, various test cases using the |
/verify with intel/llvm-test-suite#1416 |
0b42d32
to
dfd2fd8
Compare
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.
LGTM
/summary:run |
dfd2fd8
to
e62aa6e
Compare
I rebased this PR and explicitly disabled kernel fusion on Windows, to avoid breaking the post-commit Windows CI while we work on finalizing Windows support. The updated PR also addresses an issue around symbol visibility that was causing problems with the Intel GPU driver. |
/testwin |
e62aa6e
to
8c71652
Compare
Signed-off-by: Lukas Sommer <[email protected]>
8c71652
to
0e2701f
Compare
Thanks for the feedback @dm-vodopyanov and @bader! I addressed your comments in the latest version. |
Thanks for the approval! I'm not authorized to merge this, can someone of @bader or @intel/llvm-gatekeepers merge this please? |
if(WIN32) | ||
message(WARNING "Kernel fusion not yet supported on Windows") | ||
else(WIN32) | ||
add_subdirectory(jit-compiler) | ||
add_subdirectory(passes) | ||
add_subdirectory(test) |
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.
@sommerlukas, unfortunately, compilation of jit-compiler
with clang (XCode compiler to be precise) fails.
See https://github.com/intel/llvm/actions/runs/3910984924/jobs/6683827601.
/Users/runner/work/llvm/llvm/src/llvm/include/llvm/Support/Casting.h:280:45: error: unused parameter 'f' [-Werror,-Wunused-parameter]
static inline bool isPossible(const From &f) { return true; }
^
/Users/runner/work/llvm/llvm/src/llvm/include/llvm/Support/Casting.h:604:41: error: unused parameter 't' [-Werror,-Wunused-parameter]
static inline bool isPresent(const T &t) { return true; }
^
2 errors generated.
It's a bit surprising, but it looks like LLVM is less strict on enforcing "no warnings" policy.
I think we should avoid mis-compilations due to errors in external code like this.
To be honest, I'm sure how did we end-up with enabling -Werror
for jit-compiler
project. I know that we enabled it for sycl
project by setting SYCL_ENABLE_WERROR
CMake variable, but it should not impact jit-compiler
. Could you investigate, please?
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.
Hi @bader,
thanks for reporting this.
The file which causes this error is jit_compiler.cpp
, which is not part of sycl-fusion
(i.e., the JIT compiler), but sycl
itself (lives in sycl/source/detail
) and connects the SYCL runtime to the JIT compiler. As it is compiled as part of the SYCL runtime, I think it is expected that it is compiled with -Werror
if SYCL_ENABLE_WERROR
is set.
The warnings (which then become errors with -Werror
) are caused by including LLVMContext.h
in JITContext.h
, which in turn is included by jit_compiler.cpp
. I'll look into how we can avoid including LLVMContext.h
here by using an opaque pointer or similar.
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.
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.
I'm able to compile with
SYCL_ENABLE_WERROR=ON
in my local build (Linux, Clang 10).
Were you able to reproduce the problem before the fix with your local build (i.e. Linux, Clang 10)?
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.
Yes, with SYCL_ENABLE_WERROR=ON
, my local build failed with the same error message before implementing this fix.
Test different scenarios for kernel fusion, including creation of the fused kernel by the JIT compiler and performance optimizations such as dataflow internalization. Automatically detect availability of the kernel fusion extension in the DPC++ build in `lit.cfg.py` and make it available for `REQUIRES` clauses. Spec: intel/llvm#7098 Implementation: intel/llvm#7831 Signed-off-by: Lukas Sommer <[email protected]>
Test different scenarios for kernel fusion, including creation of the fused kernel by the JIT compiler and performance optimizations such as dataflow internalization. Automatically detect availability of the kernel fusion extension in the DPC++ build in `lit.cfg.py` and make it available for `REQUIRES` clauses. Spec: intel#7098 Implementation: intel#7831 Signed-off-by: Lukas Sommer <[email protected]>
…uite#1535) Test different scenarios for kernel fusion, including creation of the fused kernel by the JIT compiler and performance optimizations such as dataflow internalization. Automatically detect availability of the kernel fusion extension in the DPC++ build in `lit.cfg.py` and make it available for `REQUIRES` clauses. Spec: intel#7098 Implementation: intel#7831 Signed-off-by: Lukas Sommer <[email protected]>
This is the fifth 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 patch connects the JIT compiler for kernel fusion (
sycl-fusion
) with the SYCL runtime.configure.py
to disable it.The integration of the JIT compiler into the SYCL RT is described in this design document.
Signed-off-by: Lukas Sommer [email protected]