-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
[Fix][torch.compile] fix unique_filepath #25732
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
Signed-off-by: zjy0516 <[email protected]>
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.
Code Review
This pull request adds the unique_filepath utility function, which was intended to be included in a previous PR. The implementation finds a unique file path by incrementing an integer suffix. My review identifies a critical Time-of-Check to Time-of-Use (TOCTOU) race condition in the current implementation. I've suggested a fix that uses an atomic file creation operation to prevent potential file conflicts and data corruption in multi-threaded or multi-process environments. Additionally, I recommend adding unit tests for this new utility to ensure its correctness and handle edge cases, as they appear to be missing.
Signed-off-by: zjy0516 <[email protected]>
Signed-off-by: zjy0516 <[email protected]>
da40185 to
4e86dc3
Compare
Signed-off-by: zjy0516 <[email protected]> Co-authored-by: Luka Govedič <[email protected]>
Signed-off-by: zjy0516 <[email protected]> Co-authored-by: Luka Govedič <[email protected]> Signed-off-by: yewentao256 <[email protected]>
Signed-off-by: zjy0516 <[email protected]> Co-authored-by: Luka Govedič <[email protected]> Signed-off-by: xuebwang-amd <[email protected]>
Signed-off-by: zjy0516 <[email protected]> Co-authored-by: Luka Govedič <[email protected]>
Signed-off-by: zjy0516 <[email protected]> Co-authored-by: Luka Govedič <[email protected]>
Signed-off-by: zjy0516 <[email protected]> Co-authored-by: Luka Govedič <[email protected]>
Signed-off-by: zjy0516 <[email protected]> Co-authored-by: Luka Govedič <[email protected]> Signed-off-by: xuebwang-amd <[email protected]>
Purpose
unique_filepathwas introduced in #24542 but the corresponding implementation was not included in the final commit.CC @ProExpertProg
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.