-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] persistent cache fix - directory creation and reporting improvements #13019
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] persistent cache fix - directory creation and reporting improvements #13019
Conversation
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.
Even though I'm ok to merge this patch, because it improves error reporting, which is very helpful for debugging and it does not make a situation worse, whilst being a very small fix.
I don't think that it fully resolves all the problems we have:
- using files for thread-safety doesn't seem to work, at least not in our implementation. There should either be an in-memory atomic lock, or we should have a wait loop to further iterate on
i
on a failed attempt to acquire a lock - we ignore any "extra" device images, i.e. our hash collision mechanism doesn't work
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.
LGTM overall
int OSUtil::makeDir(const char *Dir) { | ||
assert((Dir != nullptr) && "Passed null-pointer as directory name."); | ||
if (isPathPresent(Dir)) | ||
return 0; | ||
|
||
// older GCC doesn't have full C++ 17 support. | ||
#if __GNUC__ && __GNUC__ < 8 |
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.
Should we throw in this case as well, to align the two branches?
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.
changing the signature of this function leads to an ABI break. Since we need to keep this old stuff anyway, I was thinking to keep it as is.
My preference would be to change the signature, throw always, and drop GCC < 8 support, but that decision isn't mine to make.
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.
We can keep the signature as is and still throw when we would have returned a non-zero code. I don't think we're handling non-zero codes returned from this anyway, are we?
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.
std::fileystem::create_directories
throws a std::filesystem::filesystem_error
but the "old" code doesn't have std::filesystem
so can't throw that. I'm modifying it to throw std::runtime_error
We have a report of persistent cache failures. Traced to the directory creation so I switched it to use C++17 std::filesystem routines for
OSUtil::makeDir
. Also improved trace reporting.