Skip to content

[SYCL] Fix KernelFusion/abort_fusion.cpp in "--param ze_debug=-1" mode #9077

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
merged 2 commits into from
Apr 18, 2023

Conversation

aelovikov-intel
Copy link
Contributor

No description provided.

@aelovikov-intel aelovikov-intel temporarily deployed to aws April 14, 2023 22:51 — with GitHub Actions Inactive
// CHECK-NEXT: Cannot fuse kernels with different offsets or local sizes
// CHECK-NEXT: COMPUTATION OK
// CHECK: COMPUTATION OK
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I assume correctly that this change is motivated by additional output with ze_debug in between the output expected by the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.


return 0;
return num_errors == 0 ? 0 : 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change needed? Test will already fail due to missing COMPUTATION OK if there's an error.

And if a non-zero return code is desirable, should we use an assert for numErrors instead, so we can provide a message in addition to the return code? In that case, the assert could live in performFusion and less changes would be required as part of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm fine with either non-zero exit code or assert. However, using FileCheck for that purpose is unnatural and an overkill, IMO. Other tests are doing just fine using just the exit code.

Also, checking exit code allows something like

while ./a.out >/dev/null 2>&1 ; do true ; done

when working with flaky failures.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, using FileCheck to check for computation results is overkill, therefore, for most kernel fusion tests, we use asserts/exit code to detect failure.

This specific test case however uses FileCheck for a specific reason, documented at the beginning of the file:

Also check that warnings are printed when SYCL_RT_WARNING_LEVEL=1.

If you prefer to also have a non-zero exit code, assert could be used and I'm fine with replacing CHECK-NEXT with CHECK to accommodate additional output with ze_debug. The remaining changes to the test-case are not really necessary IMHO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you want me to assert inside test or main? We currently only have one call to test but if you plan on changing that then asserting in main provides more output in case of early failure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Asserting in performFusion should be enough for now.

@aelovikov-intel
Copy link
Contributor Author

@intel/llvm-gatekeepers , this PR is ready.

@steffenlarsen steffenlarsen merged commit cc57b8c into intel:sycl Apr 18, 2023
@aelovikov-intel aelovikov-intel deleted the fix_ze_debug branch May 1, 2023 16:13
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.

3 participants