Skip to content

[SYCL] Add online linking to Level Zero plugin #2238

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 4 commits into from
Aug 11, 2020

Conversation

gmlueck
Copy link
Contributor

@gmlueck gmlueck commented Jul 31, 2020

This commit adds support to the Level Zero plugin for online linking,
but the underlying Level Zero driver APIs are still missing. As a
short-term workaround, this commit includes mocked versions of those
APIs, which work only in the simple case when a single module is
"linked" to itself.

This commit adds support to the Level Zero plugin for online linking,
but the underlying Level Zero driver APIs are still missing.  As a
short-term workaround, this commit includes mocked versions of those
APIs, which work only in the simple case when a single module is
"linked" to itself.
@gmlueck gmlueck requested review from smaslov-intel and a team as code owners July 31, 2020 21:04
smaslov-intel
smaslov-intel previously approved these changes Aug 4, 2020
Copy link
Contributor

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

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

approve to get the testing started

} else {
assert(Program->State == _pi_program::Object ||
Program->State == _pi_program::Exe ||
Program->State == _pi_program::LinkedExe);
Copy link
Contributor

Choose a reason for hiding this comment

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

Every check for LinkedExe state goes with OR check for Exe state. I think it will simplify the changes if we just have single Exe state to represent both cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not true. Look at the implementation of ModuleIterator.

Copy link
Contributor

Choose a reason for hiding this comment

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

Admitted, but adding anew globally visible state to accommodate internal implementation of iterator is an overkill, in my view. We could check the number/properties of linked objects instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way I see it, State describes the shape of the data contained by the _pi_program object. There are four possible shapes, so there are four possible states. The LinkedExe state also helps a reader understand the code better. Look at the places where LinkedExe shows up in the comments. Those comments would all have to be changed if we removed this state. Also look at the long comment documenting the LinkedExe state itself. This comment would need to be moved to some less obvious place.

Practically speaking, we could of course replace if (State == LinkedExe) with something like if ((State == Exe) && !LinkedPrograms.empty()). That seems longer and less clear to me, though.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's certainly a matter of taste, so I won't insist on changing this now. Please look at the failures reported by the CI. Otherwise changes look good to me.

@smaslov-intel
Copy link
Contributor

There are few fails in CI, please resolve.

Programs created via piProgramCreateWithBinary() are always built later
via piProgramBuild().  Change piProgramBuild(), so this no longer raises
an error.

Also fix some other behavior of programs created with
piProgramCreateWithBinary(), following the model of the OpenCL spec.
@gmlueck
Copy link
Contributor Author

gmlueck commented Aug 5, 2020

@smaslov-intel

There are few fails in CI, please resolve.

My latest commit should fix these. You might need to approve this PR (again) in order to re-trigger CI testing?

smaslov-intel
smaslov-intel previously approved these changes Aug 5, 2020
Copy link
Contributor

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

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

I haven't reviewed the latest changes, approve to get testing started

@gmlueck
Copy link
Contributor Author

gmlueck commented Aug 5, 2020

And this commit addresses the CI failure on CUDA.

@bader bader requested a review from smaslov-intel August 5, 2020 20:21
Copy link
Contributor

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

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

I see no functional issues now, anything else can be dealt with later.

@bader bader merged commit ba47915 into intel:sycl Aug 11, 2020
@gmlueck gmlueck deleted the gmlueck/online-linking branch August 14, 2020 18:33
Chenyang-L pushed a commit that referenced this pull request Feb 18, 2025
Revert "update to L0 loader version v1.18.3 and don't scan _deps with Trivy or CodeQL"
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