-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][PI][L0] Skip modules without kernel inside when creating target kernel on L0 #3614
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
Signed-off-by: gejin <[email protected]>
Signed-off-by: gejin <[email protected]>
/summary:run |
Signed-off-by: gejin <[email protected]>
Signed-off-by: gejin <[email protected]>
/summary:run |
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.
LGTM
/summary:run |
Hi, @smaslov-intel |
/summary:run |
@@ -17,16 +17,15 @@ | |||
#include <cstdarg> | |||
#include <cstdio> | |||
#include <cstring> | |||
#include <level_zero/zes_api.h> |
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.
Why did you move these?
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 ran clang-format to the file before uploading the patch, it should be moved by the format tool.
Thanks very much.
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.
can you please put them back, perhaps using comments that shut of clang-format
it is weird to have them in the middle of STL includes
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.
Hi, @smaslov-intel
I just reverted the unnecessary header file change, could you please help approve again?
Thanks very much.
Signed-off-by: gejin <[email protected]>
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.
Just a NIT formatting ask
Signed-off-by: gejin <[email protected]>
On L0 backend, we iterate all models in a pi_program, for each module, we call zeKernelCreate. If the call fails due to some error other than "ze invalid kernel name", the kernel creation will fail and current program will abort.
However, this logic assume that all modules in the pi_program will have some kernel inside. If we enable SYCL device library "online" link based on piProgramLink, the assumption will be broken. At that time, the pi_program will include some modules from device library without any kernel inside(they are used to resolve undefined symbol in user's image), if we call zeKernelCreate for those module, the return value is "ze invalid argument" instead of "ze invalid kernel name". Suppose under such circumstance, the pi_program includes 2 modules, mod1 for device library without any kernel and mod2 for user's device image with target kernel, we will firstly try to zeKernelCreate for mod1 and the API returns with error "ze invalid argument", then the program will abort but in fact, we can create the target kernel with mod2.
This PR will skip all modules without any kernel inside before trying to call zeKernelCreate for them, this is done by using zeModuelGetKernelNames to query the number of kernel names in module, if kernel name num is 0, we skip it.
Thanks very much.