-
Notifications
You must be signed in to change notification settings - Fork 787
[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
Conversation
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.
There was a problem hiding this 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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.
My latest commit should fix these. You might need to approve this PR (again) in order to re-trigger CI testing? |
There was a problem hiding this 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
And this commit addresses the CI failure on CUDA. |
There was a problem hiding this 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.
Revert "update to L0 loader version v1.18.3 and don't scan _deps with Trivy or CodeQL"
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.