{"id":19028802,"url":"https://github.com/nvidia-merlin/systems","last_synced_at":"2025-04-09T13:11:07.323Z","repository":{"id":37079083,"uuid":"462440745","full_name":"NVIDIA-Merlin/systems","owner":"NVIDIA-Merlin","description":"Merlin Systems provides tools for combining recommendation models with other elements of production recommender systems (like feature stores, nearest neighbor search, and exploration strategies) into end-to-end recommendation pipelines that can be served with Triton Inference Server.","archived":false,"fork":false,"pushed_at":"2024-04-16T18:33:05.000Z","size":121120,"stargazers_count":81,"open_issues_count":37,"forks_count":29,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-04-16T23:16:32.106Z","etag":null,"topics":["deep-learning","ensemble","gpu","machine-learning","python","recommendation-system","recommender-system","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NVIDIA-Merlin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-02-22T19:16:26.000Z","updated_at":"2024-04-23T11:40:35.331Z","dependencies_parsed_at":"2023-02-18T20:45:52.902Z","dependency_job_id":"1931fa9c-ad27-4c47-a7e6-c1a5e3508e7b","html_url":"https://github.com/NVIDIA-Merlin/systems","commit_stats":{"total_commits":242,"total_committers":18,"mean_commits":"13.444444444444445","dds":0.7355371900826446,"last_synced_commit":"92340ba89f4d7984c21ac03453cabaae5142918f"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-Merlin%2Fsystems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-Merlin%2Fsystems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-Merlin%2Fsystems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA-Merlin%2Fsystems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NVIDIA-Merlin","download_url":"https://codeload.github.com/NVIDIA-Merlin/systems/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045245,"owners_count":21038554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","ensemble","gpu","machine-learning","python","recommendation-system","recommender-system","tensorflow"],"created_at":"2024-11-08T21:12:20.765Z","updated_at":"2025-04-09T13:11:07.293Z","avatar_url":"https://github.com/NVIDIA-Merlin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Merlin Systems](https://github.com/NVIDIA-Merlin/systems)\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/merlin-systems)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/merlin-systems.svg)](https://pypi.python.org/pypi/merlin-systems/)\n![GitHub License](https://img.shields.io/github/license/NVIDIA-Merlin/systems)\n[![Documentation](https://img.shields.io/badge/documentation-blue.svg)](https://nvidia-merlin.github.io/systems/stable/README.html)\n\nMerlin Systems provides tools for combining recommendation models with other elements of production recommender systems like feature stores, nearest neighbor search, and exploration strategies into end-to-end recommendation pipelines that can be served with [Triton Inference Server](https://github.com/triton-inference-server/server).\n\n## Quickstart\n\nMerlin Systems uses the Merlin Operator DAG API, the same API used in [NVTabular](https://github.com/NVIDIA-Merlin/NVTabular) for feature engineering, to create serving ensembles. To combine a feature engineering workflow and a Tensorflow model into an inference pipeline:\n\n```python\nimport tensorflow as tf\n\nfrom merlin.systems.dag import Ensemble\nfrom merlin.systems.dag.ops import PredictTensorflow, TransformWorkflow\nfrom nvtabular.workflow import Workflow\n\n# Load saved NVTabular workflow and TensorFlow model\nworkflow = Workflow.load(nvtabular_workflow_path)\nmodel = tf.keras.models.load_model(tf_model_path)\n\n# Remove target/label columns from feature processing workflowk\nworkflow = workflow.remove_inputs([\u003ctarget_columns\u003e])\n\n# Define ensemble pipeline\npipeline = (\n\tworkflow.input_schema.column_names \u003e\u003e\n\tTransformWorkflow(workflow) \u003e\u003e\n\tPredictTensorflow(model)\n)\n\n# Export artifacts to disk\nensemble = Ensemble(pipeline, workflow.input_schema)\nensemble.export(export_path)\n```\n\nAfter you export your ensemble, you reference the directory to run an instance of Triton Inference Server to host your ensemble.\n\n```shell\ntritonserver --model-repository=/export_path/\n```\n\nRefer to the [Merlin Example Notebooks](https://github.com/NVIDIA-Merlin/Merlin/tree/main/examples/ranking) for exploring notebooks that demonstrate\nhow to train and evaluate a ranking model with Merlin Models and then how to serve it as an ensemble on [Triton Inference Server](https://github.com/triton-inference-server/server).\n\nFor training models with XGBoost and Implicit, and then serving with Systems, you can visit these [examples](https://github.com/NVIDIA-Merlin/Merlin/tree/main/examples/traditional-ml).\n\n## Building a Four-Stage Recommender Pipeline\n\nMerlin Systems can also build more complex serving pipelines that integrate multiple models and external tools (like feature stores and nearest neighbor search):\n\n```python\n# Load artifacts for the pipeline\nretrieval_model = tf.keras.models.load_model(retrieval_model_path)\nranking_model = tf.keras.models.load_model(ranking_model_path)\nfeature_store = feast.FeatureStore(feast_repo_path)\n\n# Define the fields expected in requests\nrequest_schema = Schema([\n    ColumnSchema(\"user_id\", dtype=np.int32),\n])\n\n# Fetch user features, use them to a compute user vector with retrieval model,\n# and find candidate items closest to the user vector with nearest neighbor search\nuser_features = request_schema.column_names \u003e\u003e QueryFeast.from_feature_view(\n    store=feature_store, view=\"user_features\", column=\"user_id\"\n)\n\nretrieval = (\n    user_features\n    \u003e\u003e PredictTensorflow(retrieval_model_path)\n    \u003e\u003e QueryFaiss(faiss_index_path, topk=100)\n)\n\n# Filter out candidate items that have already interacted with\n# in the current session and fetch item features for the rest\nfiltering = retrieval[\"candidate_ids\"] \u003e\u003e FilterCandidates(\n    filter_out=user_features[\"movie_ids\"]\n)\n\nitem_features = filtering \u003e\u003e QueryFeast.from_feature_view(\n    store=feature_store, view=\"movie_features\", column=\"filtered_ids\",\n)\n\n# Join user and item features for the candidates and use them to predict relevance scores\ncombined_features = item_features \u003e\u003e UnrollFeatures(\n    \"movie_id\", user_features, unrolled_prefix=\"user\"\n)\n\nranking = combined_features \u003e\u003e PredictTensorflow(ranking_model_path)\n\n# Sort candidate items by relevance score with some randomized exploration\nordering = combined_features[\"movie_id\"] \u003e\u003e SoftmaxSampling(\n    relevance_col=ranking[\"output\"], topk=10, temperature=20.0\n)\n\n# Create and export the ensemble\nensemble = Ensemble(ordering, request_schema)\nensemble.export(\"./ensemble\")\n```\n\nRefer to the [Example Notebooks](https://github.com/NVIDIA-Merlin/Merlin/tree/main/examples/Building-and-deploying-multi-stage-RecSys) for exploring\n`building-and-deploying-multi-stage-RecSys` notebooks with Merlin Models and Systems.\n\n## Installation\n\nMerlin Systems requires Triton Inference Server and Tensorflow. The simplest setup is to use the [Merlin Tensorflow Inference Docker container](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow-inference), which has both pre-installed.\n\n### Installing Merlin Systems Using Pip\n\nYou can install Merlin Systems with `pip`:\n\n```shell\npip install merlin-systems\n```\n\n### Installing Merlin Systems from Source\n\nMerlin Systems can be installed from source by cloning the GitHub repository and running `setup.py`\n\n```shell\ngit clone https://github.com/NVIDIA-Merlin/systems.git\ncd systems \u0026\u0026 python setup.py develop\n```\n\n### Running Merlin Systems from Docker\n\nMerlin Systems is installed on multiple Docker containers that are available from the NVIDIA GPU Cloud (NGC) catalog.\nThe following table lists the containers that include Triton Inference Server for use with Merlin.\n\n| Container Name      | Container Location                                                                     | Functionality                                                                      |\n| ------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |\n| `merlin-hugectr`    | \u003chttps://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-hugectr\u003e    | Merlin frameworks, HugeCTR, and Triton Inference Server                            |\n| `merlin-tensorflow` | \u003chttps://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow\u003e | Merlin frameworks selected for only Tensorflow support and Triton Inference Server |\n\nIf you want to add support for GPU-accelerated workflows, you will 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.\n\n## Feedback and Support\n\nTo report bugs or get help, please [open an issue](https://github.com/NVIDIA-Merlin/Systems/issues/new/choose).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvidia-merlin%2Fsystems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvidia-merlin%2Fsystems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvidia-merlin%2Fsystems/lists"}