Skip to content

add tritonclient to base requirements#325

Closed
nv-alaiacano wants to merge 2 commits intomainfrom
laiacano/tritonclient-requirements
Closed

add tritonclient to base requirements#325
nv-alaiacano wants to merge 2 commits intomainfrom
laiacano/tritonclient-requirements

Conversation

@nv-alaiacano
Copy link
Contributor

The tritonclient library seems to be required in order to construct an Ensemble. I imagine that we could work around this by having a non-Triton runtime as the default setting for Ensembles. But if TritonExecutorRuntime is going to be the default runtime, we should include the tritonclient library in systems.

Sample single-node workflow to reproduce:

import pandas as pd

from merlin.io import Dataset
from merlin.systems.dag.ensemble import Ensemble
from merlin.systems.dag.ops.workflow import TransformWorkflow
from nvtabular import Workflow
from nvtabular.ops import LambdaOp, Rename

# Make a simple temperature scale conversion workflow
c_to_f_workflow = Workflow(
    ["input_celcius"]
    >> LambdaOp(lambda c: c * 9.0 / 5.0 + 32)
    >> Rename(name="temp_fahrenheit")  # type:ignore
)
fit_data = Dataset(pd.DataFrame({"input_celcius": [0, 25, 100]}))
c_to_f_workflow.fit(fit_data)

serving_operators = c_to_f_workflow.input_schema.column_names >> TransformWorkflow(c_to_f_workflow)
ensemble = Ensemble(serving_operators, c_to_f_workflow.input_schema)

The error I get:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[18], line 6
      3 import pandas as pd
      5 from merlin.io import Dataset
----> 6 from merlin.systems.dag.ensemble import Ensemble
      7 from merlin.systems.dag.ops.workflow import TransformWorkflow
      8 from nvtabular import Workflow

File ~/github/nvidia-merlin/systems/merlin/systems/dag/__init__.py:19
      1 #
      2 # Copyright (c) 2022, NVIDIA CORPORATION.
      3 #
   (...)
     17 # alias submodules here to avoid breaking everything with moving to submodules
     18 # flake8: noqa
---> 19 from .ensemble import Ensemble
     20 from .node import Node

File ~/github/nvidia-merlin/systems/merlin/systems/dag/ensemble.py:26
     24 from merlin.core.protocols import Transformable
     25 from merlin.dag import Graph
---> 26 from merlin.systems.dag.runtimes.triton import TritonExecutorRuntime
     29 class Ensemble:
     30     """
     31     Class that represents an entire ensemble consisting of multiple models that
     32     run sequentially in tritonserver initiated by an inference request.
     33     """

File ~/github/nvidia-merlin/systems/merlin/systems/dag/runtimes/triton/__init__.py:17
      1 #
      2 # Copyright (c) 2022, NVIDIA CORPORATION.
      3 #
   (...)
     15 #
     16 # flake8: noqa
---> 17 from merlin.systems.dag.runtimes.triton.runtime import TritonExecutorRuntime  # noqa

File ~/github/nvidia-merlin/systems/merlin/systems/dag/runtimes/triton/runtime.py:22
     19 from shutil import copyfile
     20 from typing import List, Tuple
---> 22 import tritonclient.grpc.model_config_pb2 as model_config
     23 from google.protobuf import text_format
     25 from merlin.dag import postorder_iter_nodes

ModuleNotFoundError: No module named 'tritonclient'

@nv-alaiacano nv-alaiacano added the bug Something isn't working label Apr 13, 2023
@nv-alaiacano nv-alaiacano added this to the Merlin 23.04 milestone Apr 13, 2023
@nv-alaiacano nv-alaiacano requested a review from karlhigley April 13, 2023 13:50
@karlhigley
Copy link
Contributor

Yeah, I think we should go the other direction and make it possible to use Ensembles without tritonclient

@github-actions
Copy link

Documentation preview

https://nvidia-merlin.github.io/systems/review/pr-325

@nv-alaiacano
Copy link
Contributor Author

Does it seem reasonable to add the requirement to ensure that it works for the upcoming release, then remove that requirement when we remove the dependency on it in the Ensemble code?

@karlhigley
Copy link
Contributor

Sure, I guess that could work 🤷🏻

@karlhigley karlhigley modified the milestones: Merlin 23.04, Merlin 23.05 Apr 25, 2023
@nv-alaiacano nv-alaiacano deleted the laiacano/tritonclient-requirements branch May 1, 2023 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants