Skip to content

[SYCL] native image handle support for LevelZero. #8603

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

Conversation

cperkinsintel
Copy link
Contributor

@cperkinsintel cperkinsintel commented Mar 10, 2023

New interop support for images for LevelZero. Includes make_image and interop_handle::get_native_mem.

Tests are present in this PR.

… interop_handle::get_native_mem.

Signed-off-by: Chris Perkins <[email protected]>
@cperkinsintel cperkinsintel temporarily deployed to aws March 10, 2023 04:27 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws March 10, 2023 06:21 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws March 10, 2023 17:20 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws March 10, 2023 18:31 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws March 10, 2023 19:10 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel marked this pull request as ready for review March 10, 2023 20:18
@cperkinsintel cperkinsintel requested review from a team as code owners March 10, 2023 20:18
@cperkinsintel
Copy link
Contributor Author

Jenkins/llvm-test-suite is passing over at intel/llvm-test-suite#1649

Copy link
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

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

Note that #7196 also adds some new APIs to this extension under version 4. Assuming they both go in at about the same time (and in the same DPC++ release), I think we could combine the two changes and have them both added in version 4.

@cperkinsintel cperkinsintel temporarily deployed to aws March 14, 2023 17:13 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws March 14, 2023 18:50 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel requested a review from gmlueck March 14, 2023 21:25
@cperkinsintel cperkinsintel temporarily deployed to aws April 10, 2023 16:14 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 10, 2023 16:45 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 11, 2023 16:30 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 11, 2023 18:11 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 12, 2023 19:39 — with GitHub Actions Inactive
Copy link
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

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

Spec changes LGTM

@cperkinsintel cperkinsintel temporarily deployed to aws April 12, 2023 21:38 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 12, 2023 23:18 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 12, 2023 23:49 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 12, 2023 23:49 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 13, 2023 16:30 — with GitHub Actions Inactive
@cperkinsintel
Copy link
Contributor Author

memory_consumption.cpp is a known flaky test, get_thread_id.cpp failure also known

Also I need approvals on behalf of @intel/llvm-reviewers-runtime and @intel/dpcpp-esimd-reviewers . Note: this doesn't make any real changes to ESIMD/CUDA etc, it merely expands the PI interface and adds dummy placeholder routines to those plugins.

Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

esimd emu lgtm

backend_return_t<Backend, image<Dims>> get_native_mem(
const detail::image_accessor<DataT, Dims, Mode,
/*access::target::image*/ Target,
IsPlh /*, PropertyListT */> &Acc) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

This overload confuses me a little. detail::image_accessor is a base-class of other accessor. Why can't we just have the one above, but with the inverse enable_if condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could be done that way too. I thought this was clearer because accessor is complex. We have image_accessor but there is no buffer_accessor, so the first specialization is for any type of accessor when not using target image, and this one is for image_accessor. Meaning, if in the future we were to add a third or fourth type of accessor, this code will continue to work without needing an update.

Copy link
Contributor

Choose a reason for hiding this comment

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

Meaning, if in the future we were to add a third or fourth type of accessor, this code will continue to work without needing an update.

You mean if we add more accessors variants that inherit from image_accessor? If so, I worry that this implicit behavior would be as much a detriment as suddenly we have a potentially undocumented get_native_mem variant.

As for how clear this is, I somewhat agree that using something called image_accessor is clearer (and with SYCL 2020 image accessors will be clearer to the user too), but while reading it I saw the detail namespace and my first impression was that this was an internal interface in the public space.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe this is a concern big enough to block this PR.

@cperkinsintel cperkinsintel temporarily deployed to aws April 13, 2023 23:32 — with GitHub Actions Inactive
Copy link
Contributor

@jchlanda jchlanda left a comment

Choose a reason for hiding this comment

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

CUDA/HIP LGTM

@cperkinsintel cperkinsintel temporarily deployed to aws April 14, 2023 18:55 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 15, 2023 01:38 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 17, 2023 20:42 — with GitHub Actions Inactive
@cperkinsintel cperkinsintel temporarily deployed to aws April 17, 2023 22:10 — with GitHub Actions Inactive
@cperkinsintel
Copy link
Contributor Author

@steffenlarsen / @dm-vodopyanov - you two are the only reviewers from llvm-reviewers-runtime. Ping .

@againull againull merged commit 836ceec into intel:sycl Apr 18, 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.

8 participants