Skip to content

[SYCL] Filter implicit kernel bundle images #5285

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

Conversation

steffenlarsen
Copy link
Contributor

The runtime currently uses implicit kernel bundles to allow for operations such as setting specialization constants. Since the handler does not know the kernel to launch before it is being launched, the implicit kernel bundle created is not limited to specific kernels. As an effect of this, the kernel bundle may try to build more device images than it needs.
These changes make the runtime filter the device images of implicit kernel bundles as soon as the relevant kernel is known.

The runtime currently uses implicit kernel bundles to allow for
operations such as setting specialization constants. Since the handler
does not know the kernel to launch before it is being launched, the
implicit kernel bundle created is not limited to specific kernels.
As an effect of this, the kernel bundle may try to build more device
images than it needs.
These changes make the runtime filter the device images of implicit
kernel bundles as soon as the relevant kernel is known.

Signed-off-by: Steffen Larsen <[email protected]>
@steffenlarsen
Copy link
Contributor Author

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

@s-kanaev
Copy link
Contributor

Is there any expected impact on performance?

@steffenlarsen
Copy link
Contributor Author

Is there any expected impact on performance?

If anything I would expect improved performance due to potentially fewer image builds, but there could be some rare cases where a program may have silently benefitted from building a device image early though that is a hypothetical.

Signed-off-by: Steffen Larsen <[email protected]>
s-kanaev
s-kanaev previously approved these changes Jan 12, 2022
Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

LGTM

@s-kanaev
Copy link
Contributor

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

This commit changes the strategy from having implicitly created kernel
bundles include all device images and then filter later, to have the
implicitly created kernel bundles have no device images initially and
then add the images once required kernels are known.

Signed-off-by: Steffen Larsen <[email protected]>
@steffenlarsen
Copy link
Contributor Author

Based on an offline discussion with @romanovvlad the strategy of this PR has been changed from filtering implicitly created kernel bundles with all available device images to instead create the implicitly created kernel bundles without any device images and then add them once kernels are known.

@s-kanaev and @romanovvlad - Please have a look and let me know what you think.

Note: The tests are expected to fail on Windows currently because of missing symbols. Once I have added the symbols I will verify with intel/llvm-test-suite#726

Signed-off-by: Steffen Larsen <[email protected]>
s-kanaev
s-kanaev previously approved these changes Jan 17, 2022
Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

LGTM.
Should there be any test?

@steffenlarsen
Copy link
Contributor Author

Should there be any test?

Test added in intel/llvm-test-suite#726 is still applicable.

@s-kanaev
Copy link
Contributor

Test added in intel/llvm-test-suite#726 is still applicable.

My bad. Thanks.

Signed-off-by: Steffen Larsen <[email protected]>
@steffenlarsen
Copy link
Contributor Author

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

s-kanaev
s-kanaev previously approved these changes Jan 18, 2022
Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

LGTM

@romanovvlad
Copy link
Contributor

Based on an offline discussion with @romanovvlad the strategy of this PR has been changed from filtering implicitly created kernel bundles with all available device images to instead create the implicitly created kernel bundles without any device images and then add them once kernels are known.

@s-kanaev and @romanovvlad - Please have a look and let me know what you think.

Note: The tests are expected to fail on Windows currently because of missing symbols. Once I have added the symbols I will verify with intel/llvm-test-suite#726

Thanks.

Signed-off-by: Steffen Larsen <[email protected]>
Signed-off-by: Steffen Larsen <[email protected]>
Signed-off-by: Steffen Larsen <[email protected]>
@bader bader requested review from romanovvlad and s-kanaev January 18, 2022 14:55
Signed-off-by: Steffen Larsen <[email protected]>
@bader bader merged commit 5746906 into intel:sycl Jan 19, 2022
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.

4 participants