Fix: torch >= 2.6 compatibility & multi-instance file contention #111
+16
−38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes LIBERO's compatibility with torch>=2.6 by adding
weights_only=False
totorch.load
, which is a breaking change in torch 2.6 that denies any other data structures besides tensor, primitives, and dictionary. See https://docs.pytorch.org/docs/stable/notes/serialization.html#weights-onlyWhen running LIBERO on torch 2.6, the following error occurs:
After adding the
weights_only
argument, the states can be correctly loaded and LIBERO can run on torch >= 2.6. Supposedly, this addresses #99.Further more, when running multiple processes using LIBERO for the first time, all the processes try to create the config directory and file simultaneously, causing contention.
For example, several processes may find that the config directory does not exist, and try to create it together. Only one process will succeed while the others crash directly due to folder already exists.
This PR adds file lock to prevent such contention, thereby enabling LIBERO to be used in large parallel training.