-
Notifications
You must be signed in to change notification settings - Fork 111
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
Support UR program creation from multiple device binaries #2147
base: main
Are you sure you want to change the base?
Support UR program creation from multiple device binaries #2147
Conversation
89e8d9d
to
47fafe3
Compare
There's an ongoing effort to remove this extension by making it the default behaviour for the affected entry points #1195 as it was a workaround for an issue discovered late in the last release cycle. Since it seems like there's a compelling use case I think this should be a change to |
2b1cf6e
to
584869e
Compare
Thank you, I've changed the PR to modify the core |
550df8a
to
44a2f02
Compare
source/adapters/cuda/program.cpp
Outdated
|
||
UR_CHECK_ERROR( | ||
createProgram(hContext, hDevice, size, pBinary, pProperties, phProgram)); | ||
if (numDevices == 0) |
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.
we should add this to the yml so it gets generated and used by all adapters, I think it should be an INVALID_SIZE
return:
diff --git a/scripts/core/program.yml b/scripts/core/program.yml
index 3fe2632c..2a0bc14a 100644
--- a/scripts/core/program.yml
+++ b/scripts/core/program.yml
@@ -158,6 +158,7 @@ returns:
- "`NULL != pProperties && pProperties->count > 0 && NULL == pProperties->pMetadatas`"
- $X_RESULT_ERROR_INVALID_SIZE:
- "`NULL != pProperties && NULL != pProperties->pMetadatas && pProperties->count == 0`"
+ - "`numDevices == 0`"
- $X_RESULT_ERROR_INVALID_NATIVE_BINARY:
- "If any binary in `ppBinaries` isn't a valid binary for the corresponding device in `phDevices.`"
--- #--------------------------------------------------------------------------
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.
Thanks, fixed.
@againull looks like there are conformance tests which still need updated. Some conformance tests are only enabled when the |
Oh, I see, thanks, I will check and fix that. |
Fixed remaining failures. |
Sorry, I was formatting using .clang-format in unified-runtime and latest clang-format, it turns out cppformat target needs to be used together with clang-format-15 to get the correct formatting, fixed that. Other than that only e2e tasks are failing because at least these changes intel/llvm#15637 are required in intel/llvm to use new function signature. |
Currenlty we have multiple maps of device handle to some per-device data like the module handle, logs, binary etc. Instead of having separate map for each, just put that data into a separate structure and have one map.
a6c5a64
to
b44bc43
Compare
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.
Spec, loader, CTS and CL adapter changes LGTM. It would be nice to have a test that creates a program with multiple devices and binaries but that's going to require a bit of CTS work to accommodate so I've added it to #1197 for future work.
So far, everything looks good to me, however, @againull can you create a devops branch to kick off testing with multi devices in intel/llvm? Since this is specifically for multi device, then running on PVC for the e2e tests would be ideal. By default I don't think the pre-commit runs on PVC or DG2 or anything other than GEN12 for the most part. |
Ok, sure, I will invoke such testing. |
To support multi-device AOT scenario in SYCL we need an ability to create UR program from multiple device binaries.
Changes in this PR:
urProgramCreateWithBinary
to support program creation from multiple device binaries.ur_program
to get/set per-device data like L0 module handle, build log etc. Otherwise any change in the structure of the class requires multiple changes in all UR functions which work withur_program
, in addition to this it allows to handle interop case (which implementation is an exception right now) in a single place. Also make State and some other info per-device because it is possible that UR program is associated with multiple devices andurProgramBuildExp
is called multiple times for subsets, and we have to know the state per-device.Corresponding intel/llvm PR with E2E tests: intel/llvm#15546
Also outlined minimal changes just to uplift UR tag: intel/llvm#15637