Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][ESIMD][EMU] Marking ESIMD kernels for esimd_emulator backend #751

Merged

Conversation

dongkyunahn-intel
Copy link

@dongkyunahn-intel dongkyunahn-intel commented Jan 18, 2022

This PR is to mark ESIMD kernels for esimd_emulator backend with UNSUPPORTED or XFAIL for future feature bring-up and debug.

- 'vadd_1d' and 'sycl_esimd_mix' are duplicated to
'esimd_check_vc_codegen.cpp' and 'sycl_esimd_mix_check_build_opts.cpp'
so that original kernels can run with esimd_emulator without 'CHECK'
commands and duplicated kernels can run with opencl/level_zero
backends with 'CHECK'
@dongkyunahn-intel
Copy link
Author

This PR will be merged after ESIMD_EMULATOR support is enabled by default in intel/llvm - intel/llvm#5058.

@dongkyunahn-intel dongkyunahn-intel changed the title Invoke esimd emulator check in [SYCL][ESIMD][EMU] Marking ESIMD kernels for esimd_emulator backend Jan 20, 2022
Comment on lines +77 to +99

int err_cnt = 0;

for (unsigned i = 0; i < Size; ++i) {
if (A[i] + B[i] != C[i]) {
if (++err_cnt < 10) {
std::cout << "failed at index " << i << ", " << C[i] << " != " << A[i]
<< " + " << B[i] << "\n";
}
}
}
if (err_cnt > 0) {
std::cout << " pass rate: "
<< ((float)(Size - err_cnt) / (float)Size) * 100.0f << "% ("
<< (Size - err_cnt) << "/" << Size << ")\n";
}

delete[] A;
delete[] B;
delete[] C;

std::cout << (err_cnt > 0 ? "FAILED\n" : "Passed\n");
return err_cnt > 0 ? 1 : 0;

Choose a reason for hiding this comment

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

Suggested change
int err_cnt = 0;
for (unsigned i = 0; i < Size; ++i) {
if (A[i] + B[i] != C[i]) {
if (++err_cnt < 10) {
std::cout << "failed at index " << i << ", " << C[i] << " != " << A[i]
<< " + " << B[i] << "\n";
}
}
}
if (err_cnt > 0) {
std::cout << " pass rate: "
<< ((float)(Size - err_cnt) / (float)Size) * 100.0f << "% ("
<< (Size - err_cnt) << "/" << Size << ")\n";
}
delete[] A;
delete[] B;
delete[] C;
std::cout << (err_cnt > 0 ? "FAILED\n" : "Passed\n");
return err_cnt > 0 ? 1 : 0;
return 0;

Copy link
Author

Choose a reason for hiding this comment

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

@kbobrovs , esimd_check_vc_codegen.cpp fails after being simplified with single_task - for both open_cl and level_zero. Maybe it has to be reverted.

[2022-01-27T05:52:29.296Z] /netbatch/donb02499_00/runDir/jenkins-dir/workspace/LLVM-Test-Suite-CI-TMP/LLVM-Test-Suite-CI-Linux/llvm-test-suite/SYCL/ESIMD/esimd_check_vc_codegen.cpp:41:11: error: CHECK: expected string not found in input
[2022-01-27T05:52:29.296Z] // CHECK: <const char *>: {{.*}}-vc-codegen
[2022-01-27T05:52:29.296Z]           ^
[2022-01-27T05:52:29.296Z] <stdin>:415:2: note: scanning from here
[2022-01-27T05:52:29.296Z]  <unknown> : 0x7056b0
[2022-01-27T05:52:29.296Z]  ^
[2022-01-27T05:52:29.296Z] <stdin>:418:2: note: possible intended match here
[2022-01-27T05:52:29.296Z]  <const char *>: 
[2022-01-27T05:52:29.296Z]  ^
[2022-01-27T05:52:29.296Z] 

- Unimplemented features
- Outdated memory intrinsic implementations

Matrix size limitation - matrix_transpose_glb.cpp
- Missing XFAIL markup replacing UNSUPPORTED
@@ -1,6 +1,7 @@
// TODO enable on Windows
// REQUIRES: linux && gpu
// UNSUPPORTED: cuda || hip
// XFAIL: esimd_emulator

Choose a reason for hiding this comment

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

TODO?

@@ -9,6 +9,7 @@
// TODO enable on Windows
// REQUIRES: linux && gpu
// UNSUPPORTED: cuda || hip
// XFAIL: esimd_emulator

Choose a reason for hiding this comment

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

TODO?

@@ -7,6 +7,7 @@
//
// REQUIRES: linux,gpu
// UNSUPPORTED: cuda || hip
// XFAIL: esimd_emulator

Choose a reason for hiding this comment

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

TODO?

@@ -1,5 +1,7 @@
// REQUIRES: gpu
// UNSUPPORTED: cuda || hip
// Sub-group is not supported

Choose a reason for hiding this comment

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

Suggested change
// Sub-group is not supported
// TODO Sub-group is not supported

@@ -9,6 +9,7 @@
// RUN: %clangxx -fsycl -I%S/.. %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// UNSUPPORTED: cuda || hip
// XFAIL: esimd_emulator
Copy link

@kbobrovs kbobrovs Jan 27, 2022

Choose a reason for hiding this comment

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

TODO? here and other places. We should eventually support spec constants in the emulator.

Copy link
Author

Choose a reason for hiding this comment

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

Like I showed in messenger, online_compiler check fails for all spec* tests - even if it is not required. To whom should I ask about this issue? (Someone in SYCL_RT?)

kbobrovs
kbobrovs previously approved these changes Jan 27, 2022
- Host backend and esimd_emulator backend share same header file for
memory intrinsic support - memory_intrin.h

- This sharing prevents the same header file from supporting both
backend types as some intrinsic support (e.g. __esimd_media_ld/st) are
different and they are chosen during kernel compilation - while
backends are chosen during kernel execution

- Therefore, tests invoking those implementations must not contain
'HOST_RUN_PLACEHOLDER' as the implementations require esimd_emulator
backend
- As 'CHECK' fails for 'piProgramBuild' PI_API call
@bader bader removed their request for review February 2, 2022 10:10
@dongkyunahn-intel
Copy link
Author

esimd_check_vc_codegen.cpp will be revised to minimized test as @kbobrovs suggested in a separate PR.

kbobrovs
kbobrovs previously approved these changes Feb 2, 2022
Copy link

@kbobrovs kbobrovs left a comment

Choose a reason for hiding this comment

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

LGTM, but please address the vc_code_gen test comment at your earliest convenience.

@kbobrovs kbobrovs merged commit d98407d into intel:intel Feb 8, 2022
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Apr 12, 2022
…ntel#751)

- 'vadd_1d' and 'sycl_esimd_mix' are duplicated to
'esimd_check_vc_codegen.cpp' and 'sycl_esimd_mix_check_build_opts.cpp'
so that original kernels can run with esimd_emulator without 'CHECK'
commands and duplicated kernels can run with opencl/level_zero
backends with 'CHECK'
- Add XFAIL/UNSUPPORTED markup for 
    - Unimplemented features
    - Outdated memory intrinsic implementations
- Reduce workset in matrix_transpose_glb.cpp when running on esimd_emulator 
- Removing HOST_RUN_PLACEHOLDER for ESIMD Kernels
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Jun 17, 2022
…ntel#751)

- 'vadd_1d' and 'sycl_esimd_mix' are duplicated to
'esimd_check_vc_codegen.cpp' and 'sycl_esimd_mix_check_build_opts.cpp'
so that original kernels can run with esimd_emulator without 'CHECK'
commands and duplicated kernels can run with opencl/level_zero
backends with 'CHECK'
- Add XFAIL/UNSUPPORTED markup for
    - Unimplemented features
    - Outdated memory intrinsic implementations
- Reduce workset in matrix_transpose_glb.cpp when running on esimd_emulator
- Removing HOST_RUN_PLACEHOLDER for ESIMD Kernels
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
…ntel/llvm-test-suite#751)

- 'vadd_1d' and 'sycl_esimd_mix' are duplicated to
'esimd_check_vc_codegen.cpp' and 'sycl_esimd_mix_check_build_opts.cpp'
so that original kernels can run with esimd_emulator without 'CHECK'
commands and duplicated kernels can run with opencl/level_zero
backends with 'CHECK'
- Add XFAIL/UNSUPPORTED markup for 
    - Unimplemented features
    - Outdated memory intrinsic implementations
- Reduce workset in matrix_transpose_glb.cpp when running on esimd_emulator 
- Removing HOST_RUN_PLACEHOLDER for ESIMD Kernels
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants