-
Notifications
You must be signed in to change notification settings - Fork 740
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] ccache is invalidated by random file names generated for offloaded code bundles #5260
Comments
This is caused by our integration footer implementation: we append a piece of code at the end of user-provided input and we are doing this though creating a temporary file. If my assumption is correct, then adding
Integration footer is used by implementation of some both core SYCL 2020 features and Intel extensions. At the moment, the list includes specialization constants, Tagging @mdtoguchi here as well. I guess it is possible to generate more stable name for those temporary files, but I'm afraid there could be issues if the same files are being compiled several times at the same time - temporary files would be the same and if compiler options are different in those compilations, that will lead to unexpected results. |
What I meant is whether there is any real use case for emitting the linemarkers for those temporary files, because that's what's tripping up |
I don't know exactly why are they needed here, but my guess is that besides diagnostic messages they help to generate the correct debug info. Tagging @premanandrao and @mdtoguchi to help here. I'm also not sure how useful it is to have the correct debug info for int-footer/int-header, because hopefully end user won't need to debug those parts of the toolchain. @mdtoguchi, do you think that this issue can be avoided if we change the implementation of integration footer?
To:
|
Modifying the compilation to use the footer as the main file and including the source file as an |
Tagging @bwyma for his opinion on the debug question. |
Since the issue is inactive since a year, this is just an unqualified comment that we would love to see Thanks for the deep dive already! |
Hi! There have been no updates for at least the last 60 days, though the ticket has assignee(s). @AlexeySachkov, could I ask you to take one of the following actions? :)
Thanks! |
Hi! There have been no updates for at least the last 60 days, though the issue has assignee(s). @AlexeySachkov, could you please take one of the following actions:
Thanks! |
There is work in progress to improve this behavior. It is to use a new '-include-footer' option to alleviate the temporary file generation for the footer. #14402 |
Hi! There have been no updates for at least the last 60 days, though the issue has assignee(s). @AlexeySachkov, could you please take one of the following actions:
Thanks! |
I just tested my reproducer example from above with a recent (ed2128d) build of DPC++ and I'm getting the same behavior. Do I have to pass any additional compiler flags? |
@psalz, we have discovered additional changes that are needed to address the addition of the internal header/footer files (referenced in the generated preprocessed file). This is expected to be fixed for the DPC++ 2025.1 release. |
Hi! There have been no updates for at least the last 60 days, though the issue has assignee(s). @AlexeySachkov, could you please take one of the following actions:
Thanks! |
Describe the bug
In its default "direct mode",
ccache
examines the preprocessor output to determine all dependencies for a given translation unit. In doing so,ccache
gets tripped up by the randomly generated filenames for offloaded code bundles. The preprocessor output for a small example program will look something like this (excerpt):Here, the files
/tmp/test-963ab6.cpp
,/tmp/test-header-08e0d3.h
,/tmp/test-963ab6.cpp
and/tmp/test-footer-cd3679.h
have randomly generated names that change with each compiler invocation, causing the cache to be invalidated every time.I assume this is a regression as according to #1797
ccache
should work with DPC++.NOTE: This can be worked around by using
ccache
's "depend mode" (CCACHE_DEPEND=1
), which does not parse preprocessor output to determine dependencies, relying on compiler-generated dependency files instead (-MD
/-MMD
).To Reproduce
Create file
test.cpp
:Run DPC++ with
ccache
(at least twice):Examining the produced
ccache.log
file will reveal something like this:As you can see, not only are the random names problematic,
ccache
is additionally unable to access the files which presumably get deleted right away. I'm therefore wondering whether there is any advantage (for tooling) in emitting these file names into the preprocessor output in the first place, or whether they could simply be removed.Environment:
clang version 14.0.0 (https://github.com/intel/llvm ec97c573cdf684aec779d19ac68f1e9470ca0516)
The text was updated successfully, but these errors were encountered: