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 updates the our clean and smudge filters to use async to do I/O bound operations (mostly tensorstore serialization and running git-lfs-(clean|smudge)). This is done with an async wrapper of subprocesses that mimics subprocess.run. It also includes tools for running an async function on all the k, v pairs in a dictionary so that they will happen concurrently.
The main async entry point is in the clean and smudge filters where the cleaning (or smuding) function is applied to each leaf in the parameter tree concurrently.
This also updates the Update API a little bit. This update makes async possible (i.e. some methods are converted from
def
toasync def
) and it also makes the API easier for writing new update plugins. Additionally the serializer is now passed to the update class and used internally instead of being used externally. Also things like communication with git-lfs is now done in the write method explicitly instead of being part of the LfsMeatadata creation.There are still some change wrt to documentation, typing, and the exact Updater API but I wanted to get eyes on it sooner rather than later.