Skip to content

Commit 5caf2a2

Browse files
committedMar 11, 2024·
Update documentation
1 parent 0b954e9 commit 5caf2a2

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed
 

‎cpp/README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44
* GCC version: gcc-9
55
* cmake version: 3.18+
66
* Linux
7+
8+
For convenience, a docker container can be used as the development environment to build and install Torchserve CPP
9+
```
10+
cd serve/docker
11+
# For CPU support
12+
./build_image.sh -bt dev -cpp
13+
# For GPU support
14+
./build_image.sh -bt dev -g [-cv cu121|cu118] -cpp
15+
```
16+
17+
Start the container and optionally bind mount a build directory into the container to persist build artifacts across container runs
18+
```
19+
# For CPU support
20+
docker run [-v /path/to/build/dir:/serve/cpp/_build] -it pytorch/torchserve:cpp-dev-cpu /bin/bash
21+
# For GPU support
22+
docker run --gpus all [-v /path/to/build/dir:/serve/cpp/_build] -it pytorch/torchserve:cpp-dev-gpu /bin/bash
23+
```
24+
725
## Installation and Running TorchServe CPP
826
This installation instruction assumes that TorchServe is already installed through pip/conda/source. If this is not the case install it after the `Install dependencies` step through your preferred method.
927

@@ -22,7 +40,7 @@ Then build the backend:
2240
```
2341
## Dev Build
2442
cd cpp
25-
./build.sh [-g cu121|cu118]
43+
./build.sh
2644
```
2745

2846
### Run TorchServe

‎docker/Dockerfile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax = docker/dockerfile:experimental
22
#
3-
# This file can build images for CPU with CPP backend support.
3+
# This file can build images for CPU & GPU with CPP backend support.
44
#
55
# Following comments have been shamelessly copied from https://github.com/pytorch/pytorch/blob/master/Dockerfile
66
#

0 commit comments

Comments
 (0)
Please sign in to comment.