Skip to content

[clang-linker-wrapper] Dump any device code format #17546

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

Merged
merged 5 commits into from
Mar 26, 2025

Conversation

bader
Copy link
Contributor

@bader bader commented Mar 20, 2025

Despite the option name sycl-dump-device-code it enables dumping of only SPIR-V files emitted by the translator tool. This change dumps device code right before embedding it into the fat object. The tool dumps offloading image of any format.

Dispate of the option name sycl-dump-device-code it enables dumping of
SPIR-V files emitted by the translator tool. This change dumps device
code right before embedding it into the fat object. The tool dumps
offloading image of any format.
@bader bader requested a review from a team as a code owner March 20, 2025 01:42
@bader bader temporarily deployed to WindowsCILock March 20, 2025 02:05 — with GitHub Actions Inactive
@bader bader temporarily deployed to WindowsCILock March 20, 2025 02:52 — with GitHub Actions Inactive
@bader bader temporarily deployed to WindowsCILock March 20, 2025 02:52 — with GitHub Actions Inactive
@bader bader requested a review from a team as a code owner March 20, 2025 04:14
@bader bader temporarily deployed to WindowsCILock March 20, 2025 04:15 — with GitHub Actions Inactive
@bader bader temporarily deployed to WindowsCILock March 20, 2025 04:36 — with GitHub Actions Inactive
@bader bader temporarily deployed to WindowsCILock March 20, 2025 04:36 — with GitHub Actions Inactive
@bader bader temporarily deployed to WindowsCILock March 20, 2025 15:04 — with GitHub Actions Inactive
@bader bader requested a review from maksimsab March 20, 2025 15:07
@bader bader temporarily deployed to WindowsCILock March 20, 2025 16:03 — with GitHub Actions Inactive
@bader bader temporarily deployed to WindowsCILock March 20, 2025 16:03 — with GitHub Actions Inactive
@bader
Copy link
Contributor Author

bader commented Mar 21, 2025

@maksimsab, ping.

@bader
Copy link
Contributor Author

bader commented Mar 24, 2025

@maksimsab, ping^2.

@@ -242,7 +242,7 @@ Flags<[WrapperOnlyOption]>, HelpText<"Embed LLVM IR for runtime kernel fusion">

def sycl_dump_device_code_EQ : Joined<["--", "-"], "sycl-dump-device-code=">,
Flags<[WrapperOnlyOption]>,
HelpText<"Path to the folder where the tool dumps SPIR-V device code. Other formats aren't dumped.">;
HelpText<"Directory to dump offloading images to.">;
Copy link
Contributor

Choose a reason for hiding this comment

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

This option mirrors the user facing option 'sycl-dump-device-code' which was introduced for the old offloading model here: #11132. In that PR, I see that we use this only for dumping SPIR-V code. If the idea is to extend this option to cover all possible device outputs, may be we should do this for the old offloading model as well?

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if there is any interest in supporting additional formats for "old offloading model".
The old offloading model is supposed to be replaced with the new offloading model soon. Right?

FYI: non-SPIR-V targets seems to be happy with -fsycl-device-only output. See #17390.

If we have customers for this use case, please, file a feature request to handle it separately.

Copy link
Contributor

@asudarsa asudarsa left a comment

Choose a reason for hiding this comment

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

LGTM. Suggested a nit and a possible followup. I am trying to think if we can add some testing for this.
We can add in a separate PR as well.

Thanks

@bader bader temporarily deployed to WindowsCILock March 25, 2025 16:17 — with GitHub Actions Inactive
@bader
Copy link
Contributor Author

bader commented Mar 25, 2025

@maksimsab, please, approve if there are no other change requests.

@maksimsab
Copy link
Contributor

I am trying to resolve the issue with the test locally. Need some time.

@bader
Copy link
Contributor Author

bader commented Mar 25, 2025

I am trying to resolve the issue with the test locally. Need some time.

I think before fixing the test, we need to align the way dry-run mode is handled in the code added for SYCL with the upstream approach. I suggest we remove the test in this PR and fix testing of SYCL mode as a separate change.
Does it work for you?

@maksimsab
Copy link
Contributor

OK.

@bader bader temporarily deployed to WindowsCILock March 25, 2025 16:53 — with GitHub Actions Inactive
@bader bader temporarily deployed to WindowsCILock March 25, 2025 16:53 — with GitHub Actions Inactive
@bader
Copy link
Contributor Author

bader commented Mar 26, 2025

All failures are caused by lack of machines to run the tests.

@bader bader merged commit 397d10d into intel:sycl Mar 26, 2025
20 of 22 checks passed
@bader bader deleted the device-dump-generalize branch March 26, 2025 00:42
maksimsab added a commit to maksimsab/llvm that referenced this pull request Mar 26, 2025
…g in clang-linker-wrapper

The patch allows to test SYCL Offload Wrapping using
clang-linker-wrapper in dry-run mode. Previously, it was tested by
running the tool in non dry-run mode.

The patch unites 2 debuging prints of "offload wrapper" step in
clang-linker-wrapper in Verbose/DryRun modes.

The patch returns the test case in linker-wrapper-sycl.cpp that has been
removed in intel#17546.
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.

4 participants