Closed joecummings closed 1 year ago
You have successfully added a new CodeQL configuration .github/workflows/codeql.yml:build
. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.
This seems to be a suitable stdlib fix: https://gist.github.com/jirihnidek/430d45c54311661b47fb45a3a7846537
https://gist.github.com/jirihnidek/430d45c54311661b47fb45a3a7846537
IIRC fcntl
-based approach is not portable to Windows, so need an alternative for that.
Looking into using portalocker
as a soln.
Summary: SentencePieceModel loading can cause a RuntimeError when concurrent threads try to load/download it (e.g. when using T5 tokenizer in a DDP model training). Adding a file lock ensures the first thread to acquire the lock will actually download the model and the other ones will just use the existing path (which will not contain a partially downloaded model).
This diff was inspired by D42686913 and reverts D44566854 behavior (there is no need to overwrite anymore).
It should also disable unit test flakiness such as https://www.internalfb.com/intern/test/281475067136403?ref_report_id=0 and solve https://fb.workplace.com/groups/pytorchtext/permalink/920234369294862/.
Reviewed By: joecummings
Differential Revision: D44604474
fbshipit-source-id: 1c117fb6d1e72cce31cbf30bf72d513ad535b0d4