Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libshortfin] Wire Python asyncio to IREE concurrency. (nod-ai#125)
* Add user APIs to start workers on the System. * Rework System destruction to have an explicit Shutdown phase. Use this from Python in an atexit handler to explicitly shutdown any system instances live at exit (needed to avoid various deadlocks and unsavory things). * Adds a specialized PyWorker with overrides to do Python accounting (set up event loop on the thread, GIL maintenance). * Add Worker call and call_threadsafe APIs. * Create an AbstractEventLoop that is sufficient to launch coroutines on a worker. * Clean up various init and shutdown order issues to make use resilient. * Skating towards having lightweight Process and queues to drive device work, letting them oversubscribe worker threads as needed. The same underlying APIs should be able to be made to work for C++ coroutines but that will be a separate effort. --------- Co-authored-by: Ben Vanik <[email protected]>
- Loading branch information