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

Updating Example README #183

Merged
merged 4 commits into from
Apr 5, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@

We have created a collection of Jupyter example notebooks based on different datasets to provide end-to-end examples for NVIDIA Merlin. These example notebooks demonstrate how to use NVTabular with TensorFlow, PyTorch, and [HugeCTR](https://github.com/NVIDIA/HugeCTR). Each example provides additional details about the end-to-end workflow, which includes ETL, Training, and Inference.

## Structure
## Inventory

Each example notebook is structured as follows:
- 01-Download-Convert.ipynb: Demonstrates how to download the dataset and convert it into the correct format so that it can be consumed.
- 02-ETL-with-NVTabular.ipynb: Demonstrates how to execute the preprocessing and feature engineering pipeline (ETL) with NVTabular on the GPU.
- 03a-Training-with-TF.ipynb: Demonstrates how to train a model with TensorFlow based on the ETL output.
- 03b-Training-with-PyTorch.ipynb: Demonstrates how to train a model with PyTorch based on the ETL output.
- 03c-Training-with-HugeCTR.ipynb: Demonstrates how to train a model with HugeCTR based on the ETL output.
- 03d-Training-with-FastAI.ipynb: Demonstrates how to train a model with FastAI based on the ETL output.
- 04: Demonstrates how to use Inference with the Triton Inference Server (depending on the deep learning framework).
### 1. [Deploying multi stage RecSys](https://github.com/NVIDIA-Merlin/Merlin/tree/main/examples/Deploying-multi-stage-RecSys)

## Available Example Notebooks
Recommender system pipelines are often based on multiple stages: Retrievel, Filtering, Scoring and Ordering. This example provides an end-to-end pipelines leveraging the Merlin framework by
- Processing the dataset using NVTabular
- Training a scoring model using Merlin Models
- Training a retrieval model using Merlin Models
- Building a feature store with feast and ANN index with fiass
- Deploying an end-to-end pipeline of retrieval, scoring, ANN search to Triton Inference Server with Merlin Models

### 1. [Getting Started with MovieLens](https://github.com/NVIDIA-Merlin/Merlin/tree/main/examples/getting-started-movielens)
### 2. [Getting Started with MovieLens](https://github.com/NVIDIA-Merlin/Merlin/tree/main/examples/getting-started-movielens)

The MovieLens25M is a popular dataset for recommender systems and is used in academic publications. Most users are familiar with this dataset, so we're focusing primarily on the basic concepts of NVTabular, which includes:
- Learning NVTabular to GPU-accelerate ETL (Preprocess and Feature Engineering)
Expand All @@ -24,7 +22,7 @@ The MovieLens25M is a popular dataset for recommender systems and is used in aca
- Using the NVTabular dataloader with the TensorFlow Keras model
- Using the NVTabular dataloader with PyTorch

### 2. [Scaling Large Datasets with Criteo](https://github.com/NVIDIA-Merlin/Merlin/tree/main/examples/scaling-criteo)
### 3. [Scaling Large Datasets with Criteo](https://github.com/NVIDIA-Merlin/Merlin/tree/main/examples/scaling-criteo)

[Criteo](https://ailab.criteo.com/download-criteo-1tb-click-logs-dataset/) provides the largest publicly available dataset for recommender systems with a size of 1TB of uncompressed click logs that contain 4 billion examples. We demonstrate how to scale NVTabular, as well as:
- Use multiple GPUs and nodes with NVTabular for ETL
Expand All @@ -35,6 +33,18 @@ The MovieLens25M is a popular dataset for recommender systems and is used in aca

## Running the Example Notebooks

You can run the examples with Docker containers. Docker containers are available from the NVIDIA GPU Cloud. Access the catalog of containers at http://ngc.nvidia.com/catalog/containers.

Depending on which example you want to run, you should use any one of these Docker containers:
- [Merlin-Training](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-training) (contains Merlin Core, Merlin Models, Merlin Systems, NVTabular and HugeCTR)
- [Merlin-PyTorch-Training](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-pytorch-inference) (contains Merlin Core, Merlin Models, Merlin Systems, NVTabular and PyTorch)
- [Merlin-Tensorflow-Training] (https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow-training) (contains Merlin Core, Merlin Models, Merlin Systems, NVTabular and TensorFlow)
- [Merlin-Tensorflow-Inference](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow-inference)_ (contains Merlin Core, Merlin Models, Merlin Systems, NVTabular, TensorFlow and Triton Inference Server)
- [Merlin-Inference](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-inference) (contains Merlin Core, Merlin Models, Merlin Systems, NVTabular, TensorFlow, PyTorch, HugeCTR and Triton Inference Server)

Alternatively, you can `install Merlin Models from source <../README.md#installing-merlin-models-from-source>`_ and other required libraries to run the notebooks on your host.


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:
- Merlin-Tensorflow-Training (contains NVTabular with TensorFlow)
- Merlin-Pytorch-Training (contains NVTabular with PyTorch)
Expand All @@ -47,17 +57,15 @@ To run the example notebooks using Docker containers, do the following:

1. Pull the container by running the following command:
```
docker run --runtime=nvidia --rm -it -p 8888:8888 -p 8797:8787 -p 8796:8786 --ipc=host --cap-add SYS_PTRACE <docker container> /bin/bash
docker run --gpus all --rm -it -p 8888:8888 -p 8797:8787 -p 8796:8786 -p 8000:8000 -p 8001:8001 -p 8002:8002 --ipc=host --cap-add SYS_PTRACE <docker container> /bin/bash
```
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to Add a note and refer to the read me in the Deploying-multi-stage-Recsys Readme.


**NOTE**: If you are running on Docker version 19 and higher, change ```--runtime=nvidia``` to ```--gpus all```.

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:
```
bschifferer marked this conversation as resolved.
Show resolved Hide resolved
root@2efa5b50b909:
```

2. Install jupyter-lab with `conda` or `pip` by running the following command:
2. The container may require to install jupyter-lab with `conda` or `pip` by running the following command:
```
pip install jupyterlab
```
Expand All @@ -66,9 +74,9 @@ To run the example notebooks using Docker containers, do the following:

3. Start the jupyter-lab server by running the following command:
```
jupyter-lab --allow-root --ip='0.0.0.0' --NotebookApp.token='<password>'
jupyter-lab --allow-root --ip='0.0.0.0' --NotebookApp.token='<password>' --notebook-dir=/
```

4. Open any browser to access the jupyter-lab server using <MachineIP>:8888.

5. Once in the server, navigate to the ```/nvtabular/``` directory and try out the example notebooks.
5. Once in the server, navigate to the ```/Merlin/examples/``` directory and try out the example notebooks.