Skip to content

[Driver][SYCL] Remove object upon failure #18190

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 2 commits into
base: sycl
Choose a base branch
from

Conversation

mdtoguchi
Copy link
Contributor

Typical behaviors when the compilation fails is to have the resulting output object to be removed. Due to the fact that there are multiple compilations that occur during an offload compilation, the actual final output object may not be directly associated with the compile causing it to not be removed.

Update the cleanup file list to remove the output result file regardless of the associated job action when we are performing offload.

@mdtoguchi mdtoguchi requested a review from a team as a code owner April 25, 2025 00:17
Typical behaviors when the compilation fails is to have the resulting
output object to be removed. Due to the fact that there are multiple
compilations that occur during an offload compilation, the actual final
output object may not be directly associated with the compile causing it
to not be removed.

Update the cleanup file list to remove the output result file regardless
of the associated job action when we are performing offload.

Signed-off-by: Michael D Toguchi <[email protected]>
Signed-off-by: Michael D Toguchi <[email protected]>
@@ -2708,7 +2708,11 @@ int Driver::ExecuteCompilation(
// Remove result files if we're not saving temps.
if (!isSaveTempsEnabled()) {
const JobAction *JA = cast<JobAction>(&FailingCommand->getSource());
C.CleanupFileMap(C.getResultFiles(), JA, true);
// When performing offload compilations, the result files may not match
// the JobAction that fails. In that case, do not pass in the JobAction
Copy link
Contributor

@srividya-sundaram srividya-sundaram Apr 25, 2025

Choose a reason for hiding this comment

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

// When performing offload compilations, the result files may not match the JobAction that fails.

Can you add some details on why they don't match?
And also give an example Offload JobAction for this scenario?

// REQUIRES: system-linux

// RUN: touch %t.o
// RUN: not %clangxx -fsycl -Xsycl-target-frontend -DCOMPILE_HOST_FAIL=1 -o %t.o %s
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand this test. Could you please elaborate?
I think you are creating a new object file.
And triggering a host compilation failure.
And the expectation is that the object file created gets removed?

The test description mentions, Verify object removal when the offload compilation fails , but you are triggering a host compilation failure.
Can you trigger any offload compilation action failure instead?

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.

3 participants