Skip to content

[SYCL][CUDA] Handle large Y/Z range dimensions. #7968

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
Jan 11, 2023

Conversation

mmoadeli
Copy link
Contributor

The dimensions passed to sycl::range, determine the blocks per grid and threads per blocks. Currently, calculation of thread per blocks only performed for the x dimension. This means the blocks per grid for y and z dimensions passed to cuLaunchKernel, directly come from the sycl::range arguments. This can result in an error returned on calling cuLaunchKernel, when those parameters for y and z dimensions are larger than 65535.
This PR offers a simple tuning of thread per block for larger (over 65535) values of Y and Z dimensions to make the associated blocks per grid within the allowed range.

@bader
Copy link
Contributor

bader commented Jan 10, 2023

Please, add [SYCL] title tag +

To a reasonable extent, title tags can be used to signify the component changed, e.g.: [PI], [CUDA], [Doc].

https://github.com/intel/llvm/blob/sycl/CONTRIBUTING.md#pull-request

I also recommend linking this PR to the issue #7854 to the issue automatically when PR is merged. https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue

@mmoadeli mmoadeli temporarily deployed to aws January 10, 2023 02:52 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws January 10, 2023 05:29 — with GitHub Actions Inactive
@mmoadeli mmoadeli changed the title Handle large Y/Z range dimensions. [SYCL][CUDA] Handle large Y/Z range dimensions. Jan 10, 2023
@mmoadeli
Copy link
Contributor Author

mmoadeli commented Jan 10, 2023

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

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.

Looks good! 🚀

@mmoadeli mmoadeli temporarily deployed to aws January 10, 2023 15:29 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws January 11, 2023 02:31 — with GitHub Actions Inactive
@steffenlarsen
Copy link
Contributor

/verify with #7854

@mmoadeli - Was that the intended link?

@bader bader merged commit afeb8a6 into intel:sycl Jan 11, 2023
@mmoadeli mmoadeli deleted the large-grid-yz-dim branch January 12, 2023 08:40
@mmoadeli
Copy link
Contributor Author

/verify with #7854

@mmoadeli - Was that the intended link?

@steffenlarsen, thanks, it's updated.

bader pushed a commit to intel/llvm-test-suite that referenced this pull request Jan 25, 2023
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
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.

[SYCL][CUDA] parallel_for with sycl::range fails with limitations to 65535
3 participants