Skip to content

Commit 60239f2

Browse files
committed
multipy: README updates for Beta
1 parent f5d0290 commit 60239f2

File tree

2 files changed

+54
-18
lines changed

2 files changed

+54
-18
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

+35-18
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,20 @@ 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 dependencies first.
43+
We support installing both python modules and the runtime libs using `pip
44+
install` but does require manually installing the C++ dependencies first.
3645

3746
To start with, the multipy repo should be cloned first:
47+
3848
```shell
39-
git clone https://github.com/pytorch/multipy.git
49+
git clone --recurse-submodules https://github.com/pytorch/multipy.git
4050
cd multipy
51+
52+
# (optional) if using existing checkout
4153
git submodule sync && git submodule update --init --recursive
4254
```
4355

44-
45-
#### Installing system dependencies
56+
#### Installing System Dependencies
4657

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

@@ -51,7 +62,7 @@ sudo apt update
5162
xargs sudo apt install -y -qq --no-install-recommends <build-requirements.txt
5263
```
5364

54-
#### Installing environment encapsulators
65+
#### Python Environment Setup
5566

5667
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.
5768

@@ -125,16 +136,22 @@ pip install -e . --install-option="--cmakeoff"
125136

126137
> **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.
127138
139+
## Development
128140

129-
### Running `multipy::runtime` build steps from source
141+
### Manually building `multipy::runtime` from source
130142

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:
143+
Both `docker` and `pip install` options above are wrappers around the `cmake`
144+
build of multipy's runtime. For development purposes it's often helpful to
145+
invoke `cmake` separately.
132146

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

135149
```bash
136150
# checkout repo
137-
git checkout https://github.com/pytorch/multipy.git
151+
git clone --recurse-submodules https://github.com/pytorch/multipy.git
152+
cd multipy
153+
154+
# (optional) if using existing checkout
138155
git submodule sync && git submodule update --init --recursive
139156

140157
cd multipy

0 commit comments

Comments
 (0)