Skip to content
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

Build with SYCL fails using intel/llvm compiler #2035

Open
dvrogozh opened this issue Aug 13, 2024 · 5 comments
Open

Build with SYCL fails using intel/llvm compiler #2035

dvrogozh opened this issue Aug 13, 2024 · 5 comments
Assignees
Labels
sighting Suspicious library behavior. Should be promoted to a bug when confirmed

Comments

@dvrogozh
Copy link

dvrogozh commented Aug 13, 2024

With:

Build fails if configured in the following way (that's pytorch style build, see https://github.com/pytorch/pytorch/blob/a9d34138dfd5c049305487fc9f1b8bae0cadc98e/cmake/Modules/FindMKLDNN.cmake#L48):

cmake \
  -DCMAKE_C_COMPILER=icx \
  -DCMAKE_CXX_COMPILER=icpx \
  -DDNNL_GPU_RUNTIME=SYCL \
  -DDNNL_CPU_RUNTIME=THREADPOOL \
  -DDNNL_BUILD_TESTS=OFF \
  -DDNNL_BUILD_EXAMPLES=OFF \
  -DONEDNN_BUILD_GRAPH=OFF \
  -DDNNL_LIBRARY_TYPE=STATIC \
  -DDNNL_DPCPP_HOST_COMPILER=g++ \
  ..

Note: icx/icpx are symbolic links to clang-19 built in intel/llvm.

Few files fail with the similar error. For example:

In file included from <command-line>:
/tmp/sycl_engine_base-header-11d9b7.h:46:20: error: ‘KernelInfoData’ is not a class template
   46 | template <> struct KernelInfoData<'_', 'Z', 'T', 'S', 'N', '4', 's', 'y', 'c', 'l', '3', '_', 'V', '1', '6', 'd', 'e', 't', 'a', 'i', 'l', '1', '8', 'R', 'o', 'u', 'n', 'd', 'e', 'd', 'R', 'a', 'n',
 'g', 'e', 'K', 'e', 'r', 'n', 'e', 'l', 'I', 'N', 'S', '0', '_', '4', 'i', 't', 'e', 'm', 'I', 'L', 'i', '1', 'E', 'L', 'b', '1', 'E', 'E', 'E', 'L', 'i', '1', 'E', 'Z', 'N', 'S', '0', '_', '7', 'h', 'a',
'n', 'd', 'l', 'e', 'r', '1', '8', 'c', 'o', 'p', 'y', 'A', 'c', 'c', 'T', 'o', 'A', 'c', 'c', 'H', 'e', 'l', 'p', 'e', 'r', 'I', 'h', 'L', 'i', '1', 'E', 'L', 'N', 'S', '0', '_', '6', 'a', 'c', 'c', 'e', '
s', 's', '4', 'm', 'o', 'd', 'e', 'E', '1', '0', '2', '4', 'E', 'L', 'N', 'S', '7', '_', '6', 't', 'a', 'r', 'g', 'e', 't', 'E', '2', '0', '1', '4', 'E', 'h', 'L', 'i', '1', 'E', 'L', 'S', '8', '_', '1', '0
', '2', '5', 'E', 'L', 'S', '9', '_', '2', '0', '1', '4', 'E', 'L', 'N', 'S', '7', '_', '1', '1', 'p', 'l', 'a', 'c', 'e', 'h', 'o', 'l', 'd', 'e', 'r', 'E', '0', 'E', 'L', 'S', 'A', '_', '0', 'E', 'E', 'E'
, 'N', 'S', 't', '9', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'i', 'f', 'I', 'X', 'a', 'a', 'g', 't', 'T', '0', '_', 'L', 'i', '0', 'E', 'g', 't', 'T', '4', '_', 'L', 'i', '0', 'E', 'E', 'b', 'E', '4', 't', 'y',
 'p', 'e', 'E', 'N', 'S', '0', '_', '8', 'a', 'c', 'c', 'e', 's', 's', 'o', 'r', 'I', 'T', '_', 'X', 'T', '0', '_', 'E', 'X', 'T', '1', '_', 'E', 'X', 'T', '2', '_', 'E', 'X', 'T', '7', '_', 'E', 'N', 'S',
'0', '_', '3', 'e', 'x', 't', '6', 'o', 'n', 'e', 'a', 'p', 'i', '2', '2', 'a', 'c', 'c', 'e', 's', 's', 'o', 'r', '_', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'y', '_', 'l', 'i', 's', 't', 'I', 'J', 'E', 'E', '
E', 'E', 'E', 'N', 'S', 'E', '_', 'I', 'T', '3', '_', 'X', 'T', '4', '_', 'E', 'X', 'T', '5', '_', 'E', 'X', 'T', '6', '_', 'E', 'X', 'T', '8', '_', 'E', 'S', 'J', '_', 'E', 'E', 'E', 'U', 'l', 'N', 'S', '0
', '_', '2', 'i', 'd', 'I', 'L', 'i', '1', 'E', 'E', 'E', 'E', '_', 'E', 'E'> {
      |                    ^~~~~~~~~~~~~~
In file included from <command-line>:
/tmp/sycl_engine_base-header-11d9b7.h:46:1925: error: explicit specialization of non-template ‘sycl::_V1::detail::KernelInfoData’
   46 | template <> struct KernelInfoData<'_', 'Z', 'T', 'S', 'N', '4', 's', 'y', 'c', 'l', '3', '_', 'V', '1', '6', 'd', 'e', 't', 'a', 'i', 'l', '1', '8', 'R', 'o', 'u', 'n', 'd', 'e', 'd', 'R', 'a', 'n',
 'g', 'e', 'K', 'e', 'r', 'n', 'e', 'l', 'I', 'N', 'S', '0', '_', '4', 'i', 't', 'e', 'm', 'I', 'L', 'i', '1', 'E', 'L', 'b', '1', 'E', 'E', 'E', 'L', 'i', '1', 'E', 'Z', 'N', 'S', '0', '_', '7', 'h', 'a',
'n', 'd', 'l', 'e', 'r', '1', '8', 'c', 'o', 'p', 'y', 'A', 'c', 'c', 'T', 'o', 'A', 'c', 'c', 'H', 'e', 'l', 'p', 'e', 'r', 'I', 'h', 'L', 'i', '1', 'E', 'L', 'N', 'S', '0', '_', '6', 'a', 'c', 'c', 'e', '
s', 's', '4', 'm', 'o', 'd', 'e', 'E', '1', '0', '2', '4', 'E', 'L', 'N', 'S', '7', '_', '6', 't', 'a', 'r', 'g', 'e', 't', 'E', '2', '0', '1', '4', 'E', 'h', 'L', 'i', '1', 'E', 'L', 'S', '8', '_', '1', '0
', '2', '5', 'E', 'L', 'S', '9', '_', '2', '0', '1', '4', 'E', 'L', 'N', 'S', '7', '_', '1', '1', 'p', 'l', 'a', 'c', 'e', 'h', 'o', 'l', 'd', 'e', 'r', 'E', '0', 'E', 'L', 'S', 'A', '_', '0', 'E', 'E', 'E'
, 'N', 'S', 't', '9', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'i', 'f', 'I', 'X', 'a', 'a', 'g', 't', 'T', '0', '_', 'L', 'i', '0', 'E', 'g', 't', 'T', '4', '_', 'L', 'i', '0', 'E', 'E', 'b', 'E', '4', 't', 'y',
 'p', 'e', 'E', 'N', 'S', '0', '_', '8', 'a', 'c', 'c', 'e', 's', 's', 'o', 'r', 'I', 'T', '_', 'X', 'T', '0', '_', 'E', 'X', 'T', '1', '_', 'E', 'X', 'T', '2', '_', 'E', 'X', 'T', '7', '_', 'E', 'N', 'S',
'0', '_', '3', 'e', 'x', 't', '6', 'o', 'n', 'e', 'a', 'p', 'i', '2', '2', 'a', 'c', 'c', 'e', 's', 's', 'o', 'r', '_', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'y', '_', 'l', 'i', 's', 't', 'I', 'J', 'E', 'E', '
E', 'E', 'E', 'N', 'S', 'E', '_', 'I', 'T', '3', '_', 'X', 'T', '4', '_', 'E', 'X', 'T', '5', '_', 'E', 'X', 'T', '6', '_', 'E', 'X', 'T', '8', '_', 'E', 'S', 'J', '_', 'E', 'E', 'E', 'U', 'l', 'N', 'S', '0
', '_', '2', 'i', 'd', 'I', 'L', 'i', '1', 'E', 'E', 'E', 'E', '_', 'E', 'E'> {
      |

For individual file this issue can be reproduced with:

/home/gta/git/install/bin/icpx -DCL_TARGET_OPENCL_VERSION=300 -DDNNL_ENABLE_CPU_ISA_HINTS -DDNNL_ENABLE_ITT_TASKS -DDNNL_ENABLE_MAX_CPU_ISA -DDNNL_TEST_THREADPOOL_USE_STANDALONE -DDNNL_X64=1 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/home/gta/git/oneDNN/_build/include -I/home/gta/git/oneDNN/include -I/home/gta/git/oneDNN/src -I/home/gta/git/oneDNN/src/sycl -fno-sycl-id-queries-fit-in-int -Wno-#pragma-messages -fsycl-host-compiler-options="-I/home/gta/git/oneDNN/_build/include -I/home/gta/git/oneDNN/include -DCL_TARGET_OPENCL_VERSION=300 -DDNNL_X64=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS  -Wall -Wno-unknown-pragmas -fvisibility=internal -fvisibility-inlines-hidden -fPIC -Wformat -Wformat-security -std=c++17 -fopenmp -O3 -DNDEBUG -D_FORTIFY_SOURCE=2 -Wno-deprecated-declarations -Wno-attributes -msse4.1 -fstack-protector-strong -Wno-comment -Wno-subobject-linkage -I/home/gta/git/oneDNN/src  -Wmissing-field-initializers  -Wno-strict-overflow -Wno-maybe-uninitialized -DDNNL_ENABLE_ITT_TASKS -DDNNL_ENABLE_MAX_CPU_ISA -DDNNL_ENABLE_CPU_ISA_HINTS -I/home/gta/git/oneDNN/src/sycl" -fsycl -fvisibility-inlines-hidden  -ffp-model=precise -fno-reciprocal-math -Wno-unknown-warning-option -Wall -Wno-unknown-pragmas -fvisibility=internal -msse4.1  -fPIC -Wformat -Wformat-security -fstack-protector-all -Wno-unused-command-line-argument -fsycl-host-compiler=/usr/bin/g++   -Wno-pass-failed -Wno-tautological-compare -Wno-pass-failed -Wno-recommended-option -Wno-pass-failed  -O3 -DNDEBUG -D_FORTIFY_SOURCE=2 -MD -MT capi_stream.cpp.o -MF capi_stream.cpp.o.d -o capi_stream.cpp.o -c /home/gta/git/oneDNN/src/sycl/capi/capi_stream.cpp
@dvrogozh
Copy link
Author

Observation is that build succeeds if -fsycl-host-compiler is added to compile command line.

@vpirogov
Copy link
Member

This looks like an issue with SYCL compiler headers or the way SYCL compiler is built. oneDNN code happily compiles with Intel DPC++/C++ Compiler 2024.x and open source nightly-20230801.

@dvrogozh
Copy link
Author

This looks like an issue with SYCL compiler headers or the way SYCL compiler is built. oneDNN code happily compiles with Intel DPC++/C++ Compiler 2024.x and open source nightly-20230801

I used more recent intel/llvm compiler (intel/llvm@3b91b0b. it's first included in nightly-2024-08-10). Also note that I see same issue on https://github.com/intel/llvm/tree/sycl-rel_5_2_0 branch.

Also, oneDNN builds fine with intel/llvm if it's used for all build targets. But as soon as you are using different host compiler, you see this issue.

@vpirogov
Copy link
Member

I realize that you have issues with recent builds of intel/llvm and I can reproduce it. My point is that compiler barks at it's own headers, so the issue is likely on the compiler side or in the environment.

dvrogozh added a commit to dvrogozh/pytorch that referenced this issue Aug 14, 2024
Changes:
* Added a hack to fix 2035 in oneDNN
* Commented out oneapi specific location for libOpenCL.so
* Added hacks in torch-xpu-ops to WA dpc++ and intel/llvm behavior differences

Above are hacks which need proper resolutions.

See: oneapi-src/oneDNN#2035
Requires: intel/torch-xpu-ops#635
Signed-off-by: Dmitry Rogozhkin <[email protected]>
@vpirogov vpirogov self-assigned this Aug 17, 2024
@vpirogov
Copy link
Member

Reported intel/llvm#15120

@vpirogov vpirogov added the sighting Suspicious library behavior. Should be promoted to a bug when confirmed label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sighting Suspicious library behavior. Should be promoted to a bug when confirmed
Projects
None yet
Development

No branches or pull requests

2 participants