-
Notifications
You must be signed in to change notification settings - Fork 772
[SYCL] Remove kernel set id to fix kernel lookup #10551
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
[SYCL] Remove kernel set id to fix kernel lookup #10551
Conversation
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
} | ||
|
||
std::lock_guard<std::mutex> KernelIDsGuard(m_KernelIDsMutex); | ||
// TODO: There may be cases with sycl::program class usage in source code |
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.
sycl::program
class doesn't exists anymore in our implementation, I doubt that this comment should be re-populated throughout the codebase
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.
comment introduced in 2019 and haven't been fixed for years (9095749). Removing comment as outdated
std::vector<pi_device_binary> RawImgs(std::distance(ItBegin, ItEnd)); | ||
auto It = ItBegin; | ||
for (unsigned I = 0; It != ItEnd; ++It, ++I) | ||
RawImgs[I] = const_cast<pi_device_binary>(&It->second->getRawData()); |
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.
const_cast
? Can we leave without it?
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 const cast is not introduced by my change, just moved.
The method that is used here has const return value and const itself:
const pi_device_binary_struct &getRawData(). Then we are getting pointer to that value that has type const pi_device_binary_struct*.
piextDeviceSelectBinary where array is passed to accepts non const data that leads to the necessity of this cast. We could remove const from getRawData return value but I prefer to do cast explicitly only where it is needed and keep it const.
What do you think?
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
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 overall, mostly minor comments.
/// Keeps images without entry info. | ||
/// Such images are assumed to contain all kernel associated with the module. | ||
/// Access must be guarded by the \ref m_KernelIDsMutex mutex. | ||
std::unordered_set<RTDeviceBinaryImage *> m_UniversalKernelSet; |
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.
Do we still need this? I think this is just left from when we didn't have kernel entry information embedded in the fat binary, which, after several ABI breaking windows, shouldn't be something we support anymore.
You mentioned that this is still used by some of the tests. Assuming it's done there just for convenience, can we rewrite them to make use of the "proper" path and get rid of this universal kernel set logic altogether?
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.
adding filter to throw out useless device image generated when no device code is present in application, will be fixed
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 comment is not blocking this review and can be applied in a follow-up PR.
fixed reviewer's comments. converting to draft for a while to double check possible memory leaks of images |
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
|
||
/// Caches all exported symbols to allow faster lookup when excluding these | ||
// from kernel bundles. | ||
/// Access must be guarded by the m_KernelIDsMutex mutex. | ||
std::unordered_set<std::string> m_ExportedSymbols; | ||
|
||
/// Keeps all device images we are refering to during program lifetime. Used | ||
/// for proper cleanup. | ||
std::unordered_set<RTDeviceBinaryImageUPtr> m_DeviceImages; |
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.
Non-blocking: why is this an unordered_set
instead of a plain vector? Do we ever expect a duplicate image to be inserted here?
@@ -0,0 +1,45 @@ | |||
// REQUIRES: gpu, TEMPORARY_DISABLED |
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 disabled due to a test issue, agreed to have this fixed and enabled in a follow-up PR.
|
||
if (m_UniversalKernelSet.size()) |
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.
if (m_UniversalKernelSet.size()) | |
if (!m_UniversalKernelSet.empty()) |
Nitpick
if (m_UniversalKernelSet.size()) | ||
return getDeviceImage(m_UniversalKernelSet, Context, Device, | ||
JITCompilationIsRequired); | ||
else |
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.
else |
Non-blocking, no else after return.
Since this PR is urgent and the only remaining comments are non-blocking, I'm merging it as is. Please, address the remaining comments shortly in a follow-up PR. |
The intel/llvm/pull/10551 has been merged, so the build should succeed and produce working binary.
The intel/llvm/pull/10551 has been merged, so the build should succeed and produce working binary. The intel/llvm project has transitioned from sycl-nightly tags to nightly tags instead.
The intel/llvm/pull/10551 has been merged, so the build should succeed and produce working binary. The intel/llvm project has transitioned from sycl-nightly/YYYYMMDD tags to nightly-YYYY-MM-DD tags instead.
The intel/llvm/pull/10551 has been merged, so the build should succeed and produce working binary. The intel/llvm project has transitioned from sycl-nightly/YYYYMMDD tags to nightly-YYYY-MM-DD tags instead. The artifact of intel/llvm nightly build has also changed the name and the structure. Adjusting the code for that.
The intel/llvm/pull/10551 has been merged, so the build should succeed and produce working binary. The intel/llvm project has transitioned from sycl-nightly/YYYYMMDD tags to nightly-YYYY-MM-DD tags instead. The artifact of intel/llvm nightly build has also changed the name and the structure. Adjusting the code for that.
No description provided.