Skip to content

Commit 1d60f2e

Browse files
committed
multipy: README updates for Beta
1 parent 2c5585d commit 1d60f2e

File tree

2 files changed

+58
-19
lines changed

2 files changed

+58
-19
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# CHANGELOG
2+
3+
## multipy-0.1.0
4+
5+
This is the initial Beta release of `torch::deploy`.
6+
7+
* PyTorch 1.13 support
8+
* Python 3.7-3.10 support
9+
* `torch::deploy` is now suitable for use in production environments.
10+
* `torch::deploy` uses the current Python environment and no longer
11+
requires building PyTorch, Python and C extensions from source.
12+
* C extensions can be installed via standard `pip`/`conda` and will be
13+
dynamically loaded at runtime. Popular PyTorch extensions have been tested but
14+
there may be some libraries that are incompatible. If you run into an
15+
incompatible library please file an issue.
16+
* Prototype aarch64 support
17+
* Improved performance and memory usage when keeping an InterpreterSession alive
18+
for a long time.
19+
* Supports all PyTorch core backends (CPU/CUDA/ROCm).

README.md

+39-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)
1+
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE) ![Runtime Tests](https://github.com/pytorch/multipy/actions/workflows/runtime_tests.yaml/badge.svg)
22

33

4-
# \[experimental\] MultiPy
4+
# `torch::deploy` (MultiPy)
55

6-
> :warning: **This is project is still a prototype.** Only Linux x86 is supported, and the API may change without warning. Furthermore, please **USE PYTORCH NIGHTLY** when using `multipy::runtime`!
7-
8-
`MultiPy` (formerly `torch::deploy` and `torch.package`) is a system that allows you to run multi-threaded python code in C++. It offers `multipy.package` (formerly `torch.package`) in order to package code into a mostly hermetic format to deliver to `multipy::runtime` (formerly `torch::deploy`) which is a runtime which takes packaged
9-
code and runs it using multiple embedded Python interpreters in a C++ process without a shared global interpreter lock (GIL). For more information on how `MultiPy` works
6+
`torch::deploy` (MultiPy for non-PyTorch use cases) is a C++ library that enables you to run eager mode PyTorch models in production without any modifications to your model to support tracing. `torch::deploy` provides a way to run using multiple independent Python interpreters in a single process without a shared global interpreter lock (GIL). For more information on how `torch::deploy` works
107
internally, please see the related [arXiv paper](https://arxiv.org/pdf/2104.00254.pdf).
118

9+
To learn how to use `torch::deploy` see [Installation](#installation) and [Examples](#examples).
10+
11+
Requirements:
12+
13+
* PyTorch 1.13+ or PyTorch nightly
14+
* Linux (ELF based)
15+
* x86_64 (Beta)
16+
* arm64/aarch64 (Prototype)
17+
18+
> ℹ️ This is project is in Beta. `torch::deploy` is ready for use in production environments but may have some rough edges that we're continuously working on improving. We're always interested in hearing feedback and usecases that you might have. Feel free to reach out!
19+
1220
## Installation
1321

14-
### Building `multipy::runtime` via Docker
22+
### Building via Docker
1523

16-
The easiest way to build multipy, along with fetching all interpreter dependencies, is to do so via docker.
24+
The easiest way to build deploy and install the interpreter dependencies is to do so via docker.
1725

1826
```shell
19-
git clone https://github.com/pytorch/multipy.git
27+
git clone --recurse-submodules https://github.com/pytorch/multipy.git
2028
cd multipy
2129
export DOCKER_BUILDKIT=1
2230
docker build -t multipy .
@@ -32,17 +40,23 @@ docker run --rm multipy multipy/runtime/build/test_deploy
3240

3341
### Installing via `pip install`
3442

35-
We support installing both python modules and the runtime libs using `pip install`, with the caveat of having to manually install the C++ dependencies first. This also serves as a single-command source build, essentially being a wrapper around `python setup.py develop`, once all the dependencies have been installed.
43+
We support installing both python modules and the runtime libs using `pip
44+
install`, with the caveat of having to manually install the C++ dependencies
45+
first. This serves as a single-command source build, essentially being a wrapper
46+
around `python setup.py develop`, once all the dependencies have been installed.
47+
48+
49+
To start with, the multipy repo should be cloned first:
3650

37-
To start with, the multipy repo should be cloned:
3851
```shell
39-
git clone https://github.com/pytorch/multipy.git
52+
git clone --recurse-submodules https://github.com/pytorch/multipy.git
4053
cd multipy
54+
55+
# (optional) if using existing checkout
4156
git submodule sync && git submodule update --init --recursive
4257
```
4358

44-
45-
#### Installing system dependencies
59+
#### Installing System Dependencies
4660

4761
The runtime system dependencies are specified in `build-requirements.txt`. To install them on Debian-based systems, one could run:
4862

@@ -51,7 +65,7 @@ sudo apt update
5165
xargs sudo apt install -y -qq --no-install-recommends <build-requirements.txt
5266
```
5367

54-
#### Installing environment encapsulators
68+
#### Python Environment Setup
5569

5670
We support both `conda` and `pyenv`+`virtualenv` to create isolated environments to build and run in. Since `multipy` requires a position-independent version of python to launch interpreters with, for `conda` environments we use the prebuilt `libpython-static=3.x` libraries from `conda-forge` to link with at build time, and for `virtualenv`/`pyenv` we compile python with `-fPIC` to create the linkable library.
5771

@@ -125,16 +139,22 @@ pip install -e . --install-option="--cmakeoff"
125139

126140
> **NOTE** As of 10/11/2022 the linking of prebuilt static fPIC versions of python downloaded from `conda-forge` can be problematic on certain systems (for example Centos 8), with linker errors like `libpython_multipy.a: error adding symbols: File format not recognized`. This seems to be an issue with `binutils`, and the steps in https://wiki.gentoo.org/wiki/Project:Toolchain/Binutils_2.32_upgrade_notes/elfutils_0.175:_unable_to_initialize_decompress_status_for_section_.debug_info can help. Alternatively, the user can go with the `virtualenv`/`pyenv` flow above.
127141
142+
## Development
128143

129-
### Running `multipy::runtime` build steps from source
144+
### Manually building `multipy::runtime` from source
130145

131-
Both `docker` and `pip install` options above are wrappers around the `cmake build` of multipy's runtime. If the user wishes to run the build steps manually instead, as before the dependencies would have to be installed in the user's (isolated) environment of choice first. After that the following steps can be executed:
146+
Both `docker` and `pip install` options above are wrappers around the `cmake`
147+
build of multipy's runtime. For development purposes it's often helpful to
148+
invoke `cmake` separately.
132149

133-
#### Building
150+
See the install section for how to correctly setup the Python environment.
134151

135152
```bash
136153
# checkout repo
137-
git checkout https://github.com/pytorch/multipy.git
154+
git clone --recurse-submodules https://github.com/pytorch/multipy.git
155+
cd multipy
156+
157+
# (optional) if using existing checkout
138158
git submodule sync && git submodule update --init --recursive
139159

140160
cd multipy

0 commit comments

Comments
 (0)