|
1 | 1 | # Deploying a Multi-Stage Recommender System |
2 | 2 |
|
3 | | -We created two Jupyter notebooks that demonstrate two different stages of a Recommender Systems. |
4 | | -The goal of the notebooks is to show how to deploy a multi-stage Recommender System and serve recommendations with Triton Inference Server. |
| 3 | +We created two Jupyter notebooks that demonstrate two different stages of recommender systems. |
| 4 | +The notebooks show how to deploy a multi-stage recommender system and serve recommendations with Triton Inference Server. |
5 | 5 | The notebooks demonstrate how to use the NVTabular, Merlin Models, and Merlin Systems libraries for feature engineering, training, and then inference. |
6 | 6 |
|
7 | 7 | The two example notebooks are structured as follows: |
8 | 8 |
|
9 | | -- [Building the Recommender System](01-Building-Recommender-Systems-with-Merlin.ipynb): |
| 9 | +- [Building the Recommender System](01-Building-Recommender-Systems-with-Merlin.ipynb): |
10 | 10 | - Execute the preprocessing and feature engineering pipeline (ETL) with NVTabular on the GPU/CPU. |
11 | 11 | - Train a ranking and retrieval model with TensorFlow based on the ETL output. |
12 | 12 | - Export the saved models, user and item features, and item embeddings. |
13 | 13 |
|
14 | | -- [Deploying the Recommender System with Triton](02-Deploying-multi-stage-RecSys-with-Merlin-Systems.ipynb): |
| 14 | +- [Deploying the Recommender System with Triton](02-Deploying-multi-stage-RecSys-with-Merlin-Systems.ipynb): |
15 | 15 | - Set up a Feast feature store for feature storing and a Faiss index for similarity search. |
16 | 16 | - Build a multi-stage recommender system ensemble pipeline with Merlin Systems operators. |
17 | 17 | - Perform inference with the Triton Inference Server using the Merlin Systems library. |
18 | 18 |
|
19 | 19 | ## Running the Example Notebooks |
20 | 20 |
|
21 | | -Merlin docker containers are available on http://ngc.nvidia.com/catalog/containers/ with pre-installed versions. For `Building-and-deploying-multi-stage-RecSys` example notebooks we used `merlin-tensorflow-inference` container that has NVTabular with TensorFlow and Triton Inference support. |
| 21 | +Containers with the Merlin libraries are available from the NVIDIA NGC catalog. |
| 22 | +To run the sample notebooks, use the `merlin-tensorflow` container. |
22 | 23 |
|
23 | | -To run the example notebooks using Docker containers, do the following: |
| 24 | +You can pull and run the `nvcr.io/nvidia/merlin/merlin-tensorflow:nightly` container. |
24 | 25 |
|
25 | | -1. Once you pull the inference container, launch it by running the following command: |
26 | | - ``` |
27 | | - docker run -it --gpus all -p 8000:8000 -p 8001:8001 -p 8002:8002 -p 8888:8888 -v <path to your data>:/workspace/data/ --ipc=host <docker container> /bin/bash |
28 | | - ``` |
29 | | -The container will open a shell when the run command execution is completed. You can remove the `--gpus all` flag to run the example on CPU. |
| 26 | +> In production, instead of using the `nightly` tag, specify a release tag. |
| 27 | +> You can find the release tags and more information on the [Merlin TensorFlow](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow) container page. |
30 | 28 |
|
31 | | -1. You will have to start JupyterLab on the Docker container. First, install jupyter-lab with the following command if it is missing: |
32 | | - ``` |
33 | | - pip install jupyterlab |
| 29 | +To run the example notebooks using a container, do the following: |
| 30 | + |
| 31 | +1. After you pull the container, launch it by running the following command: |
| 32 | + |
| 33 | + ```shell |
| 34 | + docker run -it --gpus all -p 8000:8000 -p 8001:8001 -p 8002:8002 -p 8888:8888 \ |
| 35 | + -v <path to your data>:/workspace/data/ --ipc=host \ |
| 36 | + nvcr.io/nvidia/merlin/merlin-tensorflow:nightly /bin/bash |
34 | 37 | ``` |
35 | | - |
36 | | - For more information, see [Installation Guide](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html). |
37 | 38 |
|
38 | | -2. Start the jupyter-lab server by running the following command: |
| 39 | + You can remove the `--gpus all` flag to run the example on CPU. |
| 40 | + |
| 41 | + The container opens a shell when the run command execution is complete. |
| 42 | + Your shell prompt should look similar to the following example: |
| 43 | + |
| 44 | + ```text |
| 45 | + root@2efa5b50b909: |
39 | 46 | ``` |
| 47 | + |
| 48 | +1. Start JupyterLab by running the following command: |
| 49 | + |
| 50 | + ```shell |
40 | 51 | jupyter-lab --allow-root --ip='0.0.0.0' --NotebookApp.token='<password>' |
41 | 52 | ``` |
42 | 53 |
|
43 | | -3. Open any browser to access the jupyter-lab server using `localhost:8888`. |
| 54 | + View the messages in your terminal to identify the URL for JupyterLab. |
| 55 | + The messages in your terminal should show lines like the following example: |
| 56 | + |
| 57 | + ```text |
| 58 | + Or copy and paste one of these URLs: |
| 59 | + http://2efa5b50b909:8888/lab?token=9b537d1fda9e4e9cadc673ba2a472e247deee69a6229ff8d |
| 60 | + or http://127.0.0.1:8888/lab?token=9b537d1fda9e4e9cadc673ba2a472e247deee69a6229ff8d |
| 61 | + ``` |
| 62 | + |
| 63 | +1. Open a browser and use the `127.0.0.1` URL provided in the messages from JupyterLab. |
44 | 64 |
|
45 | | -4. Once in the server, navigate to the ```/Merlin/examples/Building-and-deploying-multi-stage-RecSys/``` directory and execute the example notebooks. |
| 65 | +1. After you log in to JupyterLab, navigate to the ```/Merlin/examples/Building-and-deploying-multi-stage-RecSys/``` directory and execute the example notebooks. |
0 commit comments