-
Notifications
You must be signed in to change notification settings - Fork 791
[SYCL RTC] Workaround data race related to the VFS containing toolchain #20360
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
Conversation
Unfortunately, hits compilation times pretty hard... Before (locally):
After (same system):
Despite that, I think we still should proceed with this PR because stability is more important. I'll just have to follow-up on the performance later. |
This regressed due to intel#19924 but, apparently, we didn't have proper tests in place. I'm not sure what's causing this exactly, but having each compilation create its unique `ToolchainFS` instead of all of them using the same `llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> SYCLToolchain::ToolchainFS` somehow results in the test (added in this PR) passing consistently.
5340413
to
3c8a50b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we actually tripping on this? Maybe we should slow-walk merging this until its better understood? The performance hit is sobering.
On the test I'm adding here and on other tests I'm adding to verify future |
intel#19924 essentially made it `static` but that caused data races that were later fixed by intel#20360 changing each use of it to re-create this in-memory FS (essentially, "removing" `static`), incurring significant performance costs. This PR addresses the issue by "adding" `thread_local` instead of "removing" `static` allowing us to have both no crashes due to data races and minimal overhead. No tests added as the one from intel#20360 is verifying this.
This regressed due to #19924 but, apparently, we didn't have proper tests in place. I'm not sure what's causing this exactly, but having each compilation create its unique
ToolchainFS
instead of all of them using the samellvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> SYCLToolchain::ToolchainFS
somehow results in the test (added in this PR) passing consistently.