-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add T4R to README. - Wordsmithing in 01 notebook for building a RecSys. - Flake8_nb fixes in 01 notebook. - Update example README to include summary of the SageMaker notebook. - Update the README for Building a RecSys. - Add the merlin-tensorflow:nightly container and URL for NGC to find the release tags. - Update the instructions for starting the container.
- Loading branch information
1 parent
f108304
commit 9ab0d04
Showing
4 changed files
with
72 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 39 additions & 18 deletions
57
examples/Building-and-deploying-multi-stage-RecSys/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,66 @@ | ||
# Deploying a Multi-Stage Recommender System | ||
|
||
We created two Jupyter notebooks that demonstrate two different stages of a Recommender Systems. | ||
The goal of the notebooks is to show how to deploy a multi-stage Recommender System and serve recommendations with Triton Inference Server. | ||
We created two Jupyter notebooks that demonstrate two different stages of recommender systems. | ||
The notebooks show how to deploy a multi-stage recommender system and serve recommendations with Triton Inference Server. | ||
The notebooks demonstrate how to use the NVTabular, Merlin Models, and Merlin Systems libraries for feature engineering, training, and then inference. | ||
|
||
The two example notebooks are structured as follows: | ||
|
||
- [Building the Recommender System](01-Building-Recommender-Systems-with-Merlin.ipynb): | ||
- [Building the Recommender System](01-Building-Recommender-Systems-with-Merlin.ipynb): | ||
- Execute the preprocessing and feature engineering pipeline (ETL) with NVTabular on the GPU/CPU. | ||
- Train a ranking and retrieval model with TensorFlow based on the ETL output. | ||
- Export the saved models, user and item features, and item embeddings. | ||
|
||
- [Deploying the Recommender System with Triton](02-Deploying-multi-stage-RecSys-with-Merlin-Systems.ipynb): | ||
- [Deploying the Recommender System with Triton](02-Deploying-multi-stage-RecSys-with-Merlin-Systems.ipynb): | ||
- Set up a Feast feature store for feature storing and a Faiss index for similarity search. | ||
- Build a multi-stage recommender system ensemble pipeline with Merlin Systems operators. | ||
- Perform inference with the Triton Inference Server using the Merlin Systems library. | ||
|
||
## Running the Example Notebooks | ||
|
||
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. | ||
Containers with the Merlin libraries are available from the NVIDIA NGC catalog. | ||
To run the sample notebooks, use the `merlin-tensorflow` container. | ||
|
||
To run the example notebooks using a container, do the following: | ||
|
||
You can use the `nvcr.io/nvidia/merlin/merlin-hugectr:nightly` container. | ||
|
||
To run the example notebooks using Docker containers, do the following: | ||
|
||
1. Once you pull the inference container, launch it by running the following command: | ||
``` | ||
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 | ||
``` | ||
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. | ||
|
||
1. You will have to start JupyterLab on the Docker container. First, install jupyter-lab with the following command if it is missing: | ||
```shell | ||
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 \ | ||
nvcr.io/nvidia/merlin/merlin-tensorflow:nightly /bin/bash | ||
``` | ||
pip install jupyterlab | ||
``` | ||
|
||
For more information, see [Installation Guide](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html). | ||
|
||
2. Start the jupyter-lab server by running the following command: | ||
> In production, instead of using the `nightly` tag, specify a release tag. | ||
> 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. | ||
You can remove the `--gpus all` flag to run the example on CPU. | ||
|
||
The container opens a shell when the run command execution is complete. | ||
Your shell prompt should look similar to the following example: | ||
|
||
```text | ||
root@2efa5b50b909: | ||
``` | ||
|
||
1. Start JupyterLab by running the following command: | ||
|
||
```shell | ||
jupyter-lab --allow-root --ip='0.0.0.0' --NotebookApp.token='<password>' | ||
``` | ||
|
||
3. Open any browser to access the jupyter-lab server using `localhost:8888`. | ||
View the messages in your terminal to identify the URL for JupyterLab. | ||
The messages in your terminal should show lines like the following example: | ||
|
||
```text | ||
Or copy and paste one of these URLs: | ||
http://2efa5b50b909:8888/lab?token=9b537d1fda9e4e9cadc673ba2a472e247deee69a6229ff8d | ||
or http://127.0.0.1:8888/lab?token=9b537d1fda9e4e9cadc673ba2a472e247deee69a6229ff8d | ||
``` | ||
|
||
1. Open a browser and use the `127.0.0.1` URL provided in the messages from JupyterLab. | ||
|
||
4. Once in the server, navigate to the ```/Merlin/examples/Building-and-deploying-multi-stage-RecSys/``` directory and execute the example notebooks. | ||
1. After you log in to JupyterLab, navigate to the ```/Merlin/examples/Building-and-deploying-multi-stage-RecSys/``` directory and execute the example notebooks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters