Skip to content

[SYCL] Fix linking of compressed device images when dependencies are not compressed #18906

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 7 commits into from
Jun 11, 2025

Conversation

uditagarwal97
Copy link
Contributor

@uditagarwal97 uditagarwal97 commented Jun 10, 2025

Problem
When linking device images, we reject dependencies whose image format does not match the parent image. However, consider the case when parent image is compressed, while dependencies are not (demonstrated in the test case attached to this PR). In this case, we are incorrectly rejecting device images and thus causing No device image found for external symbol error.

Solution
If the format of the main and dependent device image differs and one of them is compressed, we decompress them and recheck the format of decompressed device images.
One side-effect of this solution is that now we'll have to decompress device images, even if we are not using them. For example, when format of decompressed main and dependent images differs. Unfortunately, there's no way to find format of the compressed device image, without first decompressing it.
However, I don't think this will incur a significant overhead as (1) we decompress device image only once and cache it for subsequent use, and (2) we decompress only if the dependent device image has an export symbol that main device image wants (when finding which images to link) and if it is compatible with the device.

@uditagarwal97 uditagarwal97 changed the title [SYCL] Add test for linking uncompressed device images with a compressed one. [SYCL] Fix linking of compressed device image when dependencies are not compressed Jun 10, 2025
@uditagarwal97 uditagarwal97 marked this pull request as ready for review June 10, 2025 21:42
@uditagarwal97 uditagarwal97 requested a review from a team as a code owner June 10, 2025 21:42
@uditagarwal97
Copy link
Contributor Author

@jinge90 @steffenlarsen fyi. This is the bug that was causing pytorch test failure in CMPLRLLVM-67948. Turns out #16729 merely exposed it.

@uditagarwal97 uditagarwal97 changed the title [SYCL] Fix linking of compressed device image when dependencies are not compressed [SYCL] Fix linking of compressed device images when dependencies are not compressed Jun 10, 2025
@uditagarwal97
Copy link
Contributor Author

uditagarwal97 commented Jun 11, 2025

CUDA failure is a known flaky bug, tracked in #17285

@uditagarwal97 uditagarwal97 merged commit 1774004 into sycl Jun 11, 2025
23 of 24 checks passed
@uditagarwal97 uditagarwal97 deleted the private/udit/compressed_dev_image_link branch June 11, 2025 16:54
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