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

[SYCL][HIP] Fix assert tests #1083

Merged
merged 1 commit into from
Aug 2, 2022
Merged

[SYCL][HIP] Fix assert tests #1083

merged 1 commit into from
Aug 2, 2022

Conversation

npmiller
Copy link

Assert is now implemented for HIP.

Additionally fixing the assert multiple tus tests led to fixing the
sycl-external.cpp test. It turns out that the AMDGPU llvm backend was
running some dead code elimination and deleting SYCL_EXTERNAL
functions, this is also why kernel_bundle_ignore_sycl_external.cpp
worked on AMD, not because it was behaving correctly but because the DCE
was deleting the SYCL_EXTERNAL function so it looked "ignored" from
the kernel bundle, this test is now marked as failing again.

The tests in this PR are fixed by intel/llvm#6424

Assert is now implemented for HIP.

Additionally fixing the assert multiple tus tests led to fixing the
`sycl-external.cpp` test. It turns out that the AMDGPU llvm backend was
running some dead code elimination and deleting `SYCL_EXTERNAL`
functions, this is also why `kernel_bundle_ignore_sycl_external.cpp`
worked on AMD, not because it was behaving correctly but because the DCE
was deleting the `SYCL_EXTERNAL` function so it looked "ignored" from
the kernel bundle, this test is now marked as failing again.
@jchlanda
Copy link

@npmiller depending on how the implementation of assert message is handled by AMD, you might want to add SYCL_PI_SUPPRESS_ERROR_MESSAGE, similar to: #1089

@npmiller
Copy link
Author

That's a good point, but I don't think it would be helpful because in this case it hits an abort in the HIP driver itself so it never gets to the check_error function.

The tests worked locally but they might end up being flaky as well, and since it's all in the driver I'm not sure there's much we can do but leave them marked unsupported again.

@asudarsa
Copy link

Changes look good to me. Thanks. But I will hold off on approval till there is some analysis/comment about the new test failures.

bader pushed a commit to intel/llvm that referenced this pull request Aug 2, 2022
This patch adds an implementation of `__assert_fail` for HIP. It is
implemented in IR because the function needs to take pointers with no
address space and OpenCL compilation makes them private. It is
implemented using the OCKL printf functions provided by HIP.

In addition this patch also fixes `SYCL_EXTERNAL` for HIP, the AMDGPU
backend runs some dead code elimination and would simply delete
`SYCL_EXTERNAL` functions, and so this patch prevents the AMDGPU backend
from deleting `SYCL_EXTERNAL` functions, identifying them through
the `sycl-module-id` attribute (as done in other places such as
`sycl-post-link`). This issue showed up in some of the assert tests that
use multiple translation units, and this patch also fixes the `sycl-external.cpp` test.

Matching `llvm-test-suite` update: intel/llvm-test-suite#1083
@bader bader merged commit c4d6c14 into intel:intel Aug 2, 2022
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Mar 22, 2023
Assert is now implemented for HIP.

Additionally fixing the assert multiple tus tests led to fixing the
`sycl-external.cpp` test. It turns out that the AMDGPU llvm backend was
running some dead code elimination and deleting `SYCL_EXTERNAL`
functions, this is also why `kernel_bundle_ignore_sycl_external.cpp`
worked on AMD, not because it was behaving correctly but because the DCE
was deleting the `SYCL_EXTERNAL` function so it looked "ignored" from
the kernel bundle, this test is now marked as failing again.
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
Assert is now implemented for HIP.

Additionally fixing the assert multiple tus tests led to fixing the
`sycl-external.cpp` test. It turns out that the AMDGPU llvm backend was
running some dead code elimination and deleting `SYCL_EXTERNAL`
functions, this is also why `kernel_bundle_ignore_sycl_external.cpp`
worked on AMD, not because it was behaving correctly but because the DCE
was deleting the `SYCL_EXTERNAL` function so it looked "ignored" from
the kernel bundle, this test is now marked as failing again.
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.

4 participants