Comments (3)
Mixing async and normal code can be tricky. Here is the skeleton of a common way to do it (sorry if I over-explain).
- Update the calls to tenorstore code to use the async versions of things (generally add an await and turn the function into an async def)
- Make a write all function who's job is to start all of the async tasks
- Execute this writer in a blocking way.
async write_tracked_file(...):
"""This is the update to make the tensorstore write async."""
async write_all_tracked_files(...):
"""This is what schedules the async tasks to be done concurrently."""
await aysncio.gather(
write_tracked_file(x) for x in ...
)
# From your real code. This is executing it in a blocking way in the main synchronous code
asyncio.run(write_all_tacked_files(...))
If we want to have a minimum python version of 3.7 we can just use this asyncio.run
, otherwise we probably need a custom runner like
def async_run(to_run):
loop = asyncio.get_event_loop()
return loop.run_until_complete(write_all_tracked_files)
Let me know if anything is unclear
from git-theta.
The new update class modules changes how this will need to be implemented, we probably need to have async
versions of the write and apply methods on those objects. We will also need to see if multiple async methods accessing different git commits causes contention, but effective parallelism/concurrency could be a major win
from git-theta.
This was done in #121
from git-theta.
Related Issues (20)
- Add an "apply to all" option to merge actions
- Parameter groups that are more than just tensors? HOT 3
- Add a way to script merges
- Functionality for partial model loading HOT 3
- Method to tell if git-theta wasn't installed? HOT 4
- Pytorch Checkpoint reading
- Git Add can have high memory usage.
- Finer-grained control of `git theta install` HOT 1
- Tensorflow model loading/saving seems bugged
- `git theta ls-files` HOT 1
- Git-Theta Clean
- Hanging when crashing
- More intelligent concurrency limits
- Investigate using cffi to speed up git lfs interface
- Configurable Serialization, Combining, and Saving to a backend
- Add `__str__` to metadata object HOT 1
- Update CI to handle MacOS
- Add retry to end2end tests
- in the `clean` filter, auto-detect checkpoint handler based on file extension HOT 1
- [end2ends] push repos to Hugging Face Hub (and git clone from there) to ensure it works HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-theta.