Serving with asyncio, multiprocessing, and batching
Project description
mpservice
Utilities for Python concurrency, including
-
Serving with multiprocessing to make full use of multiple cores, and batching to take advantage of vectorized computation if some components of the service have that capability.
One use case is machine learning model serving, although the code is generic and not restricted to this particular use case.
-
Stream processing, i.e. processing a long, possibly infinite stream of input data, with multiple operators in the pipeline. A main use case is that one or more of the operators is I/O bound (think: calling an external service), hence can benefit from concurrency. Both sync and async interfaces are provided.
The serving and streaming utilities can be combined because a mpservice.mpserver.MPServer
instance, while doing heavy-lifting in other processes, acts as an
I/O bound operator in the main process. Indeed, mpservice.mpserver.MPServer
provides methods stream
and async_stream
for using the server to process data streams.
The package also contains some other related utilities.
To install, do pip install mpservice
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mpservice-0.9.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f71ecab3dc0dbb329c612ab4e59cf9acb5e817b2ef950bd6cd2cbfe775537599 |
|
MD5 | b7d3d1fa74d6e840a71a46429882db39 |
|
BLAKE2b-256 | df1b9cdc38ebd19e998242bac628bb062c4dec38c39e286b46cf6c86b01787d2 |