Skip to content

[SYCL][ESIMD][EMU] Handle intrinsic operations promoted to 4-byte element type #5727

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

Conversation

dongkyunahn-intel
Copy link
Contributor

  • scatter_impl() and gather_impl() in memory.hpp promote argument/return vector to 4-byte elements
  • ESIMD_EMULATOR backend handles this promoted vectors

…lement type

- scatter_impl() and gather_impl() in memory.hpp promote
argument/return vector to 4-byte elements

- ESIMD_EMULATOR backend handles this promoted vectors
@dongkyunahn-intel dongkyunahn-intel requested a review from a team as a code owner March 3, 2022 23:34
@dongkyunahn-intel
Copy link
Contributor Author

This PR replaces #5702

dongkyunahn-intel and others added 2 commits March 4, 2022 14:19
…ntrin.hpp

Co-authored-by: kbobrovs <Konstantin.S.Bobrovsky@intel.com>
…ntrin.hpp

Co-authored-by: kbobrovs <Konstantin.S.Bobrovsky@intel.com>
@@ -646,6 +657,14 @@ __esimd_gather_masked_scaled2(SurfIndAliasTy surf_ind, uint32_t global_offset,
{
static_assert(Scale == 0);

// ActualTy - Reverse of 'PromoT' in memory.hpp
using ActualTy = std::conditional_t<
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@bader bader requested a review from kbobrovs March 11, 2022 15:55
kbobrovs
kbobrovs previously approved these changes Mar 16, 2022
@bader bader changed the title [SYCL][ESIMD][EMU] Handling intrinsic operations promoted to 4-byte element type [SYCL][ESIMD][EMU] Handle intrinsic operations promoted to 4-byte element type Mar 16, 2022
@bader
Copy link
Contributor

bader commented Mar 16, 2022

@alexbatashev, take a look at https://github.com/intel/llvm/actions/runs/1966876941.

[SYCL: .github#L1](https://github.com/intel/llvm/pull/5727/files#annotation_2987610469)
Error when evaluating 'strategy' for job 'llvm_test_suite'. intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@a7d4216e937cfd2a18965af6f4bcd92bc1fafec4 (Line: 196, Col: 18): Error parsing fromJson,intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@a7d4216e937cfd2a18965af6f4bcd92bc1fafec4 (Line: 196, Col: 18): Error reading JToken from JsonReader. Path '', line 0, position 0.,intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@a7d4216e937cfd2a18965af6f4bcd92bc1fafec4 (Line: 196, Col: 18): Unexpected type of value '', expected type: Sequence.

Do you have any clues what might cause this error? I don't see any changes in workflow files, so it's strange that GitHub Actions is not able to parse them for this particular PR. I'll restart GHA pre-commit to get complete validation results.

@alexbatashev
Copy link
Contributor

@alexbatashev, take a look at https://github.com/intel/llvm/actions/runs/1966876941.

[SYCL: .github#L1](https://github.com/intel/llvm/pull/5727/files#annotation_2987610469)
Error when evaluating 'strategy' for job 'llvm_test_suite'. intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@a7d4216e937cfd2a18965af6f4bcd92bc1fafec4 (Line: 196, Col: 18): Error parsing fromJson,intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@a7d4216e937cfd2a18965af6f4bcd92bc1fafec4 (Line: 196, Col: 18): Error reading JToken from JsonReader. Path '', line 0, position 0.,intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@a7d4216e937cfd2a18965af6f4bcd92bc1fafec4 (Line: 196, Col: 18): Unexpected type of value '', expected type: Sequence.

Do you have any clues what might cause this error? I don't see any changes in workflow files, so it's strange that GitHub Actions is not able to parse them for this particular PR. I'll restart GHA pre-commit to get complete validation results.

Looks like there was an attempt to restart a single job. That feature was released today, and seems to be broken.

kbobrovs
kbobrovs previously approved these changes Mar 16, 2022
- Intermediate vectors are added to contain type-adjusted values
bridging between 'RestoredTy' (restored with TySizeLog2) and 'Ty'
@@ -449,8 +469,9 @@ __esimd_scatter_scaled(__ESIMD_DNS::simd_mask_storage_t<N> pred,

for (int idx = 0; idx < N; idx++) {
if (pred[idx]) {
Ty *addr = reinterpret_cast<Ty *>(elem_offsets[idx] + writeBase);
*addr = vals[idx];
RestoredTy *addr =
Copy link
Contributor

Choose a reason for hiding this comment

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

For later: please check with CM library devs that acquiring a mutex is really needed when accessing through a cm buffer. That seems really strange requirement. It is also strange that no mutex is needed when accessing SLM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will check with CM Lib devs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue ticket : #5863

return __ESIMD_DNS::bitcast<Ty, RestoredTy, N>(retv);
} else {
__ESIMD_DNS::vector_type_t<Ty, N> Adjusted = 0;
// TODO : Built-in function??
Copy link
Contributor

Choose a reason for hiding this comment

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

see convert_vector above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

@dongkyunahn-intel
Copy link
Contributor Author

/verify with intel/llvm-test-suite#928

1 similar comment
@dongkyunahn-intel
Copy link
Contributor Author

/verify with intel/llvm-test-suite#928

@dongkyunahn-intel
Copy link
Contributor Author

@vladimirlaz , would you help me run CI for this PR with following intel/llvm-test-suite PR? XFAIL markings need to be removed in order to prevent 'Unexpected passes' caused by this PR.

intel/llvm-test-suite#928

@kbobrovs
Copy link
Contributor

@dongkyunahn-intel, I see clang FE crashes on these sometimes:
[2022-03-19T03:48:31.028Z] Failed Tests (2):
[2022-03-19T03:48:31.028Z] SYCL :: ESIMD/Prefix_Local_sum3.cpp
[2022-03-19T03:48:31.028Z] SYCL :: ESIMD/Stencil.cpp

Could you please file an internal ticket on FE? Do you know if this is flaky failure?

@dongkyunahn-intel
Copy link
Contributor Author

Could you please file an internal ticket on FE? Do you know if this is flaky failure?

It looks like flaky failures. My another PR (#5606) does not show those failures.

@dongkyunahn-intel
Copy link
Contributor Author

dongkyunahn-intel commented Mar 22, 2022

@dongkyunahn-intel, I see clang FE crashes on these sometimes: [2022-03-19T03:48:31.028Z] Failed Tests (2): [2022-03-19T03:48:31.028Z] SYCL :: ESIMD/Prefix_Local_sum3.cpp [2022-03-19T03:48:31.028Z] SYCL :: ESIMD/Stencil.cpp

Could you please file an internal ticket on FE? Do you know if this is flaky failure?

These failures are gone after retrying failing tests. Now there are four unexpected passes (to be resolved with intel/llvm-test-suite#928) and one timeout (BitonicSortkv2).

@dongkyunahn-intel
Copy link
Contributor Author

/verify

@dongkyunahn-intel
Copy link
Contributor Author

CI fails due to unexpected pass from opencl. There is a pending PR for fixing this in intel/llvm - intel/llvm-test-suite#944.

@kbobrovs
Copy link
Contributor

The only failure is unrelated to the changes:
Unexpectedly Passed Tests (1):
SYCL :: KernelAndProgram/undefined-symbol.cpp

@kbobrovs kbobrovs merged commit 1fe5eaa into intel:sycl Mar 25, 2022
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.

4 participants