-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[OpenMP][libomptarget][DeviceRTL] Removing ASSERT macro leads to test failures #64421
Comments
@llvm/issue-subscribers-openmp |
Note: the failures above are segmentation faults. |
We segfault because the shared stack is "too small" and the fallback, which is malloc, is not implemented on AMD. So the reason this crashes is the missing malloc, not the optimizer going bad or assume/assert being wrong. The reason it works otherwise is coincidental and not backed up by anything. We effectively ignore the fact that we are not having enough shared stack for the main thread to allocate 16 bytes, and still just do it. get level is failing because we optimize better for that case. This is the actual (performance) bug we should address; optimize better if the ASSERT is present. |
Thanks for looking into this Johannes! The explanation is very helpful in understanding what's happening. |
When replacing the ASSERT macro in Debug.h i.e.:
with an empty assert:
There are 4 OpenMP tests which fail:
Further investigation has revealed that:
Removing the ASSERT in
omp_get_level()
makes thejit/empty_kernel_lvl2.c
test fail.Removing the ASSERT in
void *SharedMemorySmartStackTy::push(uint64_t Bytes) {
leads to 3 tests failing:In addition to the tests above the OpenMP opt pass produces different results based on whether the ASSERTs are present in the DeviceRTL or not.
If run with
LIBOMPTARGET_INFO=16
enabled, the launch details will change as follows based on whether the ASSERTs are present in the code or not:If the ASSERTs are present then the launch info is:
If the ASSERTs are NOT present then the launch info is:
Note the Generic VS. Generic-SPMD mode.
The presence of the ASSERTs should not influence the outcome of the optimizer and the OpenMP lit tests should not fail when the ASSERTs are removed.
The text was updated successfully, but these errors were encountered: