Skip to content

[SYCL] Don't add itt libdevice into linking list for NV,AMD,NativeCPU backend #19603

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

Open
wants to merge 8 commits into
base: sycl
Choose a base branch
from

Conversation

jinge90
Copy link
Contributor

@jinge90 jinge90 commented Jul 28, 2025

ITT device library is used by sycl-instrument-device-code for Intel Vtune support, they are not required by NV, AMD and NativeCPU backend. This PR removes ITT device library files into device linking list for these backend. After doing this, we don't need to add special check for NativeCPU backend in driver code to filter all libraries other than "native_cpu-utils".

@jinge90 jinge90 requested a review from a team as a code owner July 28, 2025 08:48
@jinge90 jinge90 marked this pull request as draft July 28, 2025 08:48
@jinge90 jinge90 temporarily deployed to WindowsCILock July 29, 2025 06:47 — with GitHub Actions Inactive
@jinge90 jinge90 temporarily deployed to WindowsCILock July 29, 2025 06:47 — with GitHub Actions Inactive
@jinge90 jinge90 requested a review from hvdijk July 29, 2025 07:13
@jinge90
Copy link
Contributor Author

jinge90 commented Jul 29, 2025

Hi, @hvdijk
Could you take a look at this PR? This PR disables itt device libraries link for NV, AMD and NativeCPU backend since itt device libraries are for Intel VTune support only. With removing itt for these backends, it will simplify driver logic a little since we don't need to filter out these itt files for NativeCPU.
Thanks very much.

@jinge90 jinge90 marked this pull request as ready for review July 29, 2025 07:22
@hvdijk
Copy link
Contributor

hvdijk commented Jul 29, 2025

Hi, @hvdijk Could you take a look at this PR?

I'm on holiday, @intel/dpcpp-nativecpu-reviewers would someone else have a look at this PR?

@jinge90
Copy link
Contributor Author

jinge90 commented Jul 31, 2025

Hi, @intel/dpcpp-nativecpu-reviewers
Could you help review this PR?
Thanks very much.

@jinge90
Copy link
Contributor Author

jinge90 commented Aug 4, 2025

Hi, @intel/dpcpp-nativecpu-reviewers
Kind ping~~.
Thanks very much.

@jinge90 jinge90 requested a review from mdtoguchi August 8, 2025 01:54
@jinge90
Copy link
Contributor Author

jinge90 commented Aug 8, 2025

Hi, @mdtoguchi
Could you help review this PR?
Thanks very much.

@jinge90
Copy link
Contributor Author

jinge90 commented Aug 8, 2025

Hi, @intel/dpcpp-nativecpu-reviewers
Kind ping~

@jinge90 jinge90 requested a review from npmiller August 8, 2025 08:34
@jinge90
Copy link
Contributor Author

jinge90 commented Aug 8, 2025

Hi, @npmiller
Could you help review this PR in the perspective of CUDA backend?
Thanks very much.

Copy link
Contributor

@npmiller npmiller left a comment

Choose a reason for hiding this comment

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

CUDA changes LGTM

@@ -5903,13 +5903,6 @@ class OffloadingActionBuilder final {
SmallString<128> LibName(LLCandidate);
llvm::sys::path::append(LibName, DeviceLib);
if (llvm::sys::fs::exists(LibName)) {
// NativeCPU currently only needs libsycl-nativecpu_utils and
// libclc, so temporarily skip other device libs in invocation.
// Todo: remove once NativeCPU tests the other libraries.
Copy link
Contributor

Choose a reason for hiding this comment

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

If the itt device library should be skipped for NativeCPU, wouldn't keeping this code achieve that, i.e. do you really need to remove this?

Note (as per the original comment) that removing this code will potentially add more device libraries to the NativeCPU link stage, which would slow down linking because NativeCPU currently only needs to link libclc and libsycl-nativecpu_utils. Linking more device libraries in NativeCPU would also need testing for the code linked from these libraries, which seems to go beyond what this PR intends to achieve, which is skipping the itt device lib for the three backends?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, @uwedolinsky
Previously, itt device libraries were added to link list together with libsycl-native_utils for nativecpu target, so the logic here is needed to filter out all other libraries except libsycl-native_utils.
Instead of adding unneeded library and then add handling logic to filter out them for nativecpu target, we stops adding itt device libraries into link list when current target is nativecpu, so we don't need to filter out any unneeded libraries.
The PR description seems to be confusing, we just skip "adding" itt device libraries into link list for native cpu/cuda/amd target.
Thanks very much.

@jinge90 jinge90 changed the title [SYCL] Skip itt libdevice for NV,AMD,NativeCPU backend [SYCL] Don't add itt libdevice into linking list for NV,AMD,NativeCPU backend Aug 9, 2025
@jinge90 jinge90 requested a review from uwedolinsky August 9, 2025 02:55
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.

5 participants