Skip to content

Commit

Permalink
Document the change to three containers (#1581)
Browse files Browse the repository at this point in the history
Beginning with the 22.06 release, the Merlin
team provides the following three containers
that are capable of training and inference:

* `merlin-hugectr`
* `merlin-tensorflow`
* `merlin-pytorch`

This is a change from the 22.05 release that
used six containers--one for training and a
separate container for inference.

Remove step to install JupyterLab
  • Loading branch information
mikemckiernan authored Jun 14, 2022
1 parent a6733bb commit 90e4346
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 52 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
repos:
- repo: https://github.com/timothycrosley/isort
rev: 5.9.3
rev: 5.10.1
hooks:
- id: isort
additional_dependencies: [toml]
exclude: examples/*
- repo: https://github.com/python/black
rev: 21.7b0
rev: 22.3.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/pycqa/pylint
rev: pylint-2.7.4
rev: v2.14.1
hooks:
- id: pylint
- repo: https://github.com/econchick/interrogate
Expand All @@ -28,12 +28,12 @@ repos:
hooks:
- id: codespell
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
rev: 1.7.4
hooks:
- id: bandit
args: [--verbose, -ll, -x, tests,examples,bench]
- repo: https://github.com/s-weigand/flake8-nb
rev: v0.3.0
rev: v0.4.0
hooks:
- id: flake8-nb
files: \.ipynb$
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,14 @@ pip install nvtabular
#### Installing NVTabular with Docker

NVTabular Docker containers are available in the [NVIDIA Merlin container
repository](https://catalog.ngc.nvidia.com/?filters=&orderBy=scoreDESC&query=merlin). There are six different containers:

repository](https://catalog.ngc.nvidia.com/?filters=&orderBy=scoreDESC&query=merlin).
The following table summarizes the key information about the containers:

| Container Name | Container Location | Functionality |
| -------------------------- | ------------------ | ------------- |
| merlin-tensorflow-inference |https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow-inference | NVTabular, Tensorflow and Triton Inference |
| merlin-pytorch-inference |https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-pytorch-inference | NVTabular, PyTorch, and Triton Inference |
| merlin-inference | https://ngc.nvidia.com/catalog/containers/nvidia:merlin:merlin-inference | NVTabular, HugeCTR, and Triton Inference |
| merlin-training | https://ngc.nvidia.com/catalog/containers/nvidia:merlin:merlin-training | NVTabular and HugeCTR |
| merlin-tensorflow-training | https://ngc.nvidia.com/catalog/containers/nvidia:merlin:merlin-tensorflow-training | NVTabular, TensorFlow, and HugeCTR Tensorflow Embedding plugin |
| merlin-pytorch-training | https://ngc.nvidia.com/catalog/containers/nvidia:merlin:merlin-pytorch-training | NVTabular and PyTorch |
| merlin-hugectr |https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-hugectr | NVTabular, HugeCTR, and Triton Inference |
| merlin-tensorflow |https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow | NVTabular, Tensorflow and Triton Inference |
| merlin-pytorch |https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-pytorch | NVTabular, PyTorch, and Triton Inference |

To use these Docker containers, you'll first need to install the [NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-docker) to provide GPU support for Docker. You can use the NGC links referenced in the table above to obtain more information about how to launch and run these containers. To obtain more information about the software and model versions that NVTabular supports per container, see [Support Matrix](https://github.com/NVIDIA/NVTabular/blob/main/docs/source/resources/support_matrix.rst).

Expand Down
51 changes: 29 additions & 22 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,46 +60,53 @@ Rossmann operates over 3,000 drug stores across seven European countries. Histor

## Running the Example Notebooks

You can run the example notebooks by [installing NVTabular](https://github.com/NVIDIA/NVTabular#installation) and other required libraries. Alternatively, Docker containers are available on http://ngc.nvidia.com/catalog/containers/ with pre-installed versions. Depending on which example you want to run, you should use any one of these Docker containers:
You can run the example notebooks by [installing NVTabular](https://github.com/NVIDIA/NVTabular#installation) and other required libraries.
Alternatively, Docker containers are available from the NVIDIA GPU Cloud (NGC) at <http://ngc.nvidia.com/catalog/containers/> with pre-installed versions.
Depending on which example you want to run, you should use any one of these Docker containers:

- Merlin-Tensorflow-Training (contains NVTabular with TensorFlow)
- Merlin-Pytorch-Training (contains NVTabular with PyTorch)
- Merlin-Training (contains NVTabular with HugeCTR)
- Merlin-Tensorflow-Inference (contains NVTabular with TensorFlow and Triton Inference support)
- `merlin-hugectr` (contains NVTabular with HugeCTR)
- `merlin-tensorflow` (contains NVTabular with TensorFlow)
- `merlin-pytorch` (contains NVTabular with PyTorch)

Beginning with the 22.06 release, each container includes the software for training models and performing inference.

To run the example notebooks using Docker containers, do the following:

1. Pull the container by running the following command:

```
```sh
docker run --gpus all --rm -it -p 8888:8888 -p 8797:8787 -p 8796:8786 --ipc=host <docker container> /bin/bash
```

**NOTES**:

- If you are running `Getting Started with MovieLens` , `Advanced Ops with Outbrain` or `Tabular Problems with Rossmann` example notebooks you need to add `-v ${PWD}:/root/` to the docker script above. Here `PWD` is a local directory in your system, and this very same directory should also be mounted to the `merlin-inference`container if you would like to run the inference example. Please follow the `start and launch triton server` instructions given in the inference notebooks.
- If you are running `Training-with-HugeCTR` notebooks, please add `--cap-add SYS_NICE` to `docker run` command to suppress the `set_mempolicy: Operation not permitted` warnings.
- If you are running Getting Started with MovieLens, Advanced Ops with Outbrain, or the Tabular Problems with Rossmann example notebooks, add a `-v ${PWD}:/root/` argument to the preceding Docker command.
The `PWD` environment variable refers to a local directory on your computer, and you should specify this same directory and with the `-v` argument when you run a container to perform inference.
Follow the instructions for starting Triton Inference Server that are provided in the inference notebooks.
- If you are running `Training-with-HugeCTR` notebooks, please add `--cap-add SYS_NICE` to the `docker run` command to suppress the `set_mempolicy: Operation not permitted` warnings.

The container will open a shell when the run command execution is completed. You will have to start JupyterLab on the Docker container. It should look similar to this:
The container opens a shell when the run command execution is completed.
Your shell prompt should look similar to the following example:

```
root@2efa5b50b909:
```
```sh
root@2efa5b50b909:
```

2. If jupyter-lab is not installed, install jupyter-lab with `pip` by running the following command:
1. Start the jupyter-lab server by running the following command:

```shell
jupyter-lab --allow-root --ip='0.0.0.0'
```
pip install jupyterlab
```

For more information, see [Installation Guide](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html).

3. Start the jupyter-lab server by running the following command:
View the messages in your terminal to identify the URL for JupyterLab.
The messages in your terminal show similar lines to the following example:

```
jupyter-lab --allow-root --ip='0.0.0.0' --NotebookApp.token='<password>'
```shell
Or copy and paste one of these URLs:
http://2efa5b50b909:8888/lab?token=9b537d1fda9e4e9cadc673ba2a472e247deee69a6229ff8d
or http://127.0.0.1:8888/lab?token=9b537d1fda9e4e9cadc673ba2a472e247deee69a6229ff8d
```

4. Open any browser to access the jupyter-lab server using <MachineIP>:8888.
1. Open a browser and use the `127.0.0.1` URL provided in the messages by JupyterLab.

5. Once in the server, navigate to the `/nvtabular/` directory and try out the examples.
1. After you log in to JupyterLab, navigate to the `/nvtabular` directory to try out the example notebooks.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
"id": "4e4592a9",
"metadata": {},
"source": [
"### Load Models on Triton Server"
"### Load Models on Triton Inference Server"
]
},
{
Expand All @@ -238,16 +238,18 @@
"metadata": {},
"source": [
"```\n",
"docker run -it --gpus=all -p 8000:8000 -p 8001:8001 -p 8002:8002 -v ${PWD}:/model nvcr.io/nvidia/merlin/merlin-inference:21.11\n",
"```"
"docker run -it --gpus=all -p 8000:8000 -p 8001:8001 -p 8002:8002 -v ${PWD}:/model nvcr.io/nvidia/merlin/merlin-hugectr:latest\n",
"```\n",
"\n",
"> For production use, refer to the [Merlin containers](https://catalog.ngc.nvidia.com/?filters=&orderBy=scoreDESC&query=merlin) from the NVIDIA GPU Cloud (NGC) catalog and specify a tag rather than `latest`."
]
},
{
"cell_type": "markdown",
"id": "c6f50e9e",
"metadata": {},
"source": [
"After you started the container you can start triton server with the command below:"
"After you start the container, start Triton Inference Server with the following command:"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,30 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Launching and Starting the Triton Server"
"## Starting Triton Inference Server"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Before we get started, you should launch the Triton Inference Server docker container with the following script. This script will mount your local `model-repository` folder that includes your saved models from the previous notebook (`03a-Training-with-TF.ipynb`) to `/model` directory in the `merlin-inference` docker container."
"Before we get started, start Triton Inference Server in the Docker container with the following command. The command includes the `-v` argument to mount your local `model-repository` directory that includes your saved models from the previous notebook (`03a-Training-with-TF.ipynb`) to `/model` directory in the container."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```\n",
"docker run -it --gpus device=0 -p 8000:8000 -p 8001:8001 -p 8002:8002 -v ${PWD}:/model/ nvcr.io/nvidia/merlin/merlin-tensorflow-inference:22.04\n",
"```\n"
"docker run -it --gpus device=0 -p 8000:8000 -p 8001:8001 -p 8002:8002 -v ${PWD}:/model/ nvcr.io/nvidia/merlin/merlin-tensorflow:latest\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"After you started the `merlin-inference` container, you can start triton server with the command below. You need to provide correct path for the `models` directory.\n",
"After you start the container, you can start Triton Inference Server with the following command. You need to provide correct path for the `models` directory.\n",
"\n",
"```\n",
"tritonserver --model-repository=path_to_models --backend-config=tensorflow,version=2 --model-control-mode=explicit \n",
Expand Down Expand Up @@ -150,14 +150,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Loading Ensemble Model with Triton Inference Serve"
"## Loading Ensemble Model with Triton Inference Server"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"At this stage, you should have launched the Triton Inference Server docker container with the instructions above."
"At this stage, you should have started the Triton Inference Server in a container with the instructions above."
]
},
{
Expand Down Expand Up @@ -336,7 +336,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Send request to Triton IS to transform raw dataset"
"## Send request to Triton Inference Server to transform raw dataset"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/scaling-criteo/docker-compose-fastai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ volumes:
services:
lab:
runtime: nvidia
image: nvcr.io/nvidia/merlin/merlin-pytorch-training:21.11
image: nvcr.io/nvidia/merlin/merlin-pytorch:22.06
command: "/bin/bash -c 'pip install jupyterlab jupytext pydot && apt-get update && apt-get install -y tree && python -m ipykernel install --user --name=merlin && jupyter notebook --no-browser --allow-root --port=8888 --ip=0.0.0.0 --NotebookApp.token='demotoken' --NotebookApp.allow_origin='*' --notebook-dir=/'"
volumes:
- models:/models
Expand Down
4 changes: 2 additions & 2 deletions examples/scaling-criteo/docker-compose-hugectr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ volumes:
services:
triton:
command: "/bin/bash -c 'tritonserver --model-repository=/model/ --backend-config=hugectr,ps=/model/ps.json --model-control-mode=explicit'"
image: nvcr.io/nvidia/merlin/merlin-inference:21:11
image: nvcr.io/nvidia/merlin/merlin-hugectr:22.06
runtime: nvidia
shm_size: "1g"
ulimits:
Expand All @@ -26,7 +26,7 @@ services:

lab:
runtime: nvidia
image: nvcr.io/nvidia/merlin/merlin-training:21:11
image: nvcr.io/nvidia/merlin/merlin-hugectr:22.06
command: "/bin/bash -c 'pip install jupyterlab jupytext pydot nvidia-pyindex tritonclient geventhttpclient && apt-get update && apt-get install -y tree && jupyter notebook --no-browser --allow-root --port=8888 --ip=0.0.0.0 --NotebookApp.token='demotoken' --NotebookApp.allow_origin='*' --notebook-dir=/'"
volumes:
- model:/model
Expand Down
4 changes: 2 additions & 2 deletions examples/scaling-criteo/docker-compose-tf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ volumes:
services:
triton:
command: "/bin/bash -c 'pip install grpcio-channelz && tritonserver --model-repository=/models/ --model-control-mode=explicit'"
image: nvcr.io/nvidia/merlin/merlin-inference:21:11
image: nvcr.io/nvidia/merlin/merlin-tensorflow:22.06
runtime: nvidia
shm_size: "1g"
ulimits:
Expand All @@ -26,7 +26,7 @@ services:

lab:
runtime: nvidia
image: nvcr.io/nvidia/merlin/merlin-tensorflow-training:21:11
image: nvcr.io/nvidia/merlin/merlin-tensorflow:22.06
command: "/bin/bash -c 'pip install jupyterlab jupytext pydot nvidia-pyindex tritonclient geventhttpclient && apt-get update && apt-get install -y tree && python -m ipykernel install --user --name=merlin && jupyter notebook --no-browser --allow-root --port=8888 --ip=0.0.0.0 --NotebookApp.token='demotoken' --NotebookApp.allow_origin='*' --notebook-dir=/'"
volumes:
- models:/models
Expand Down

0 comments on commit 90e4346

Please sign in to comment.