-
Notifications
You must be signed in to change notification settings - Fork 24.2k
[2/N] Use std::filesystem #152586
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
base: main
Are you sure you want to change the base?
[2/N] Use std::filesystem #152586
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/152586
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit d2f2e86 with merge base 61aa77e ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
4691e9b
to
80db20b
Compare
2256eb7
to
9870e67
Compare
6fc4158
to
340f73e
Compare
64b1f8e
to
c5b9334
Compare
@@ -42,7 +42,8 @@ void ProcessGroupUCCLogger::flushComms(int rank, int world_size) { | |||
std::filesystem::path trace_filename = | |||
fullpath / fmt::format("rank{}.json", rank); | |||
std::error_code ec{}; | |||
if (!std::filesystem::create_directories(fullpath, ec)) { | |||
std::filesystem::create_directories(fullpath, ec); |
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.
What about if create_directory fails because there is a currently a file a the location. Nothing is printed then
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.
The below if should be relying on the error code, right?
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.
Use std::filesystem::is_directory
is more robust.
if (!create_directories(tmp_folder)) { | ||
std::error_code ec{}; | ||
std::filesystem::create_directories(tmp_folder, ec); | ||
if (!std::filesystem::is_directory(tmp_folder)) { |
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.
Same problem here
@Skylion007 In summary, there is not platform independent system call values of success and failure... And it is unlikely that the current implementations are all based on POSIX APIs. |
Even if there isn't a platform independent way of checking error, we only really need to check error for POSIX and Windows based systems as the code was doing before. |
@Skylion007 On these systems, if the directory didn't exist before creation, |
9b7cabb
to
ccb2459
Compare
We shouldn't support GCC<9 in inductor or distributed code... |
f117b1e
to
b0eab07
Compare
Use std::filesystem in most inductor code. This is follow-up of #152288 .
The check of
std::filesystem::create_directories
has been fixed because it may return false when the directory to create already exists.cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k