Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CPU only to compose script #3365

Merged
merged 6 commits into from
Sep 15, 2021
Merged

Add CPU only to compose script #3365

merged 6 commits into from
Sep 15, 2021

Conversation

jbkyang-nvi
Copy link
Contributor

Enable compose script to compose cpu-only containers. Fixed upstream-version confusion to ensure compose script works for all branches

@jbkyang-nvi jbkyang-nvi requested review from CoderHam, deadeyegoodwin and GuanLuo and removed request for CoderHam September 14, 2021 00:35
build.py Outdated
@@ -760,6 +761,7 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu):
ENV TF_ADJUST_SATURATION_FUSED 1
ENV TF_ENABLE_WINOGRAD_NONFUSED 1
ENV TF_AUTOTUNE_THRESHOLD 2
ENV TRITON_GPU_ENABLED_BUILD {gpu_enabled}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TRITON_SERVER_GPU_ENABLED

compose.py Outdated
@@ -150,41 +151,79 @@ def create_argmap(images):
# Extract information from upstream build and create map other functions can
# use
upstreamDockerImage = images["full"]
minDockerImage = images["min"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use lower-case underscores style for variables
"upstreamDockerImage" confuses upstream meaning. Use full_docker_image

compose.py Outdated
minDockerImage = images["min"]
enable_gpu = FLAGS.enable_gpu
# Docker inspect enviroment variables
baseRunArgs = ['docker', 'inspect', '-f']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable naming style

docs/compose.md Outdated
@@ -54,7 +63,44 @@ will provide a container `tritonserver` locally. You can access the container wi
$ docker run -it tritonserver:latest
```

Note: If `compose.py` is run on release versions `r21.08` and older, the resulting container will have DCGM version 2.2.3 installed. This may result in different GPU statistic reporting behavior.
Note: If `compose.py` is run on release versions `r21.08` and older,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and earlier"

docs/compose.md Outdated
### Compose a specific version of Triton

`compose.py` requires two containers to build, a `min` container which is the
base the compose container is build from and a `full` container where the script
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build -> built

compose.py Outdated
gpu_enabled = False if e == None else True
fail_if(
not gpu_enabled,
'\'enable-gpu\' flag added but min container provided does not have CUDA installed'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of added say specified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address changes here and in other places

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were you looking at a old version? I think I addressed all your comments

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was. Looks like you address all the changes

compose.py Outdated
"nvcr.io/nvidia/tritonserver:{}-cpu-only-py3".format(
FLAGS.container_version),
"min":
"ubuntu:20.04".format(FLAGS.container_version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you adding .format(FLAGS.container_version)?

docs/compose.md Outdated
`compose.py` provides `--backend`, `--repoagent` options that allow you to specify which backends and repository agents to include in the custom image. The `--enable-gpu` flag indicates that you want to create an image that supports NVIDIA GPUs. For example, the following creates a new docker image that contains only the TensorFlow 1 and TensorFlow 2 backends and the checksum repository agent.
The `compose.py` script can be found in the [server repository](https://github.com/triton-inference-server/server).
Simply clone the repository and run `compose.py` to create a custom container.
Note created container version will depend on the branch that was cloned.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: or Note that the

docs/compose.md Outdated
`compose.py` provides `--backend`, `--repoagent` options that allow you to
specify which backends and repository agents to include in the custom image.
The `--enable-gpu` flag indicates that you want to create an image that supports
NVIDIA GPUs. For example, the following creates a new docker image that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space at start

docs/compose.md Outdated
### Compose a specific version of Triton

`compose.py` requires two containers to build, a `min` container which is the
base the compose container is build from and a `full` container where the script
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from which the script will extract components.

docs/compose.md Outdated
python3 compose.py --backend tensorflow1 --repoagent checksum --enable-gpu
```
on branch [r21.08](https://github.com/triton-inference-server/server/tree/r21.08) pulls:
- `min` container `nvcr.io/nvidia/tritonserver:21.08-py3-min`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space at start

docs/compose.md Outdated

### CPU only container composition

To compose a container that is build for only cpu usage, simply remove the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

built

docs/compose.md Outdated

To compose a container that is build for only cpu usage, simply remove the
`--enable-gpu` flag when running `compose.py`.
This will build a container from `ubuntu:20.04` docker and use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using ubuntu:20.04 as base

docs/compose.md Outdated
This will build a container from `ubuntu:20.04` docker and use
backends/repoagents from `nvcr.io/nvidia/tritonserver:<upstream-container-version>-cpu-only-py3`.
Note:
1. If composing a CPU only container, both `min` and `full` containers should be built for CPU only and not have CUDA installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When composing

compose.py Outdated
gpu_enabled = False if e == None else True
fail_if(
not gpu_enabled,
'\'enable-gpu\' flag added but min container provided does not have CUDA installed'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address changes here and in other places

@jbkyang-nvi jbkyang-nvi merged commit 0801098 into main Sep 15, 2021
@jbkyang-nvi jbkyang-nvi deleted the kyang-cpu-only-composer branch September 15, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants