Skip to content

[SYCL] Fix error handling for max_num_work_groups launch query test #15508

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

Closed

Conversation

GeorgeWeb
Copy link
Contributor

@GeorgeWeb GeorgeWeb commented Sep 25, 2024

The error capturing logic escaped me when first submitting the max_num_work_groups implementation and the tests alongside it. We want to bitwise OR the return resulting code from the test function (either 0 or 1) with 0 rather than AND-ing it.
Previously the test was still valid for what its main purpose was, which is the assertion of the value returned from the max_num_work_groups kernel-queue-specific launch query.
This fix is to better catch the negative test of launching a kernel with invalid launch configuration in the case where the query reports that no (0) workgroups can be launched on the device for that configuration (e.g. nd_range).

@GeorgeWeb GeorgeWeb force-pushed the georgi/fix-max-num-groups-test-return branch from 8f53ea5 to 35f7f19 Compare September 25, 2024 14:24
@GeorgeWeb GeorgeWeb force-pushed the georgi/fix-max-num-groups-test-return branch from 35f7f19 to b52d752 Compare September 25, 2024 14:30
@GeorgeWeb GeorgeWeb force-pushed the georgi/fix-max-num-groups-test-return branch from b52d752 to 25f53e3 Compare September 25, 2024 14:39
@GeorgeWeb GeorgeWeb changed the title [SYCL] Improve error handling for max_num_work_groups launch query test [SYCL] Fix error handling for max_num_work_groups launch query test Nov 4, 2024
@GeorgeWeb GeorgeWeb force-pushed the georgi/fix-max-num-groups-test-return branch from 25f53e3 to 8a183d0 Compare November 4, 2024 15:40
@GeorgeWeb GeorgeWeb marked this pull request as ready for review November 4, 2024 15:41
@GeorgeWeb GeorgeWeb requested a review from a team as a code owner November 4, 2024 15:41
@npmiller
Copy link
Contributor

npmiller commented Nov 5, 2024

friendly ping @steffenlarsen @intel/llvm-reviewers-runtime

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

So sorry for the delay! Overall it looks good! One small nit.

std::cerr << "Test (LocalMemory) with exceeded resource limits failed\n";
else
std::cerr << "Test with exceed resource limits failed\n";
return 1; // We shouldn't be here, exception is expected
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, you could change the return after the catch block to 1. With this, it is now dead code.

Copy link
Contributor Author

@GeorgeWeb GeorgeWeb Nov 12, 2024

Choose a reason for hiding this comment

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

Sure 👍. Addressed in a new commit.
Apologies for the force-push, it was because I rebased on latest sycl branch and messed my branch updating strategy here with what I normally do in unified-runtime where I rebase on top rather the merge.

@GeorgeWeb GeorgeWeb force-pushed the georgi/fix-max-num-groups-test-return branch from 8a183d0 to 8b938cf Compare November 12, 2024 12:25
@@ -198,19 +207,20 @@ int test_max_num_work_groups(sycl::queue &q, const sycl::device &dev) {
return 1;
}

return 0;
return result;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand the need for the result variable. In what case would we reach this and it not being 1?

@npmiller
Copy link
Contributor

The AND/OR part was fixed in #16610 so I'm not sure if this PR is still needed, but if it is would you mind rebasing it @GeorgeWeb ? it seems pretty close to being merged.

@GeorgeWeb
Copy link
Contributor Author

The AND/OR part was fixed in #16610 so I'm not sure if this PR is still needed, but if it is would you mind rebasing it @GeorgeWeb ? it seems pretty close to being merged.

@npmiller Thanks for the update! ... and apologies for slightly abandoning this one. It is not strictly needed as that was the main reason I originally opened it up. The rest are a few minor quality improvements. I am okay to close it if you think that's fine.

@npmiller npmiller closed this Feb 18, 2025
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