Skip to content

Commit

Permalink
Merge InferenceNode functionality from Systems into the base Node
Browse files Browse the repository at this point in the history
… class (#357)

* migrate inf operator to base operator

* migrate inf node to node

* remove model registry from core and make export a no op by default

* remove mention of triton in base op and node code

* change model config to config.

* removed the return for export docs

* remove unnecessary import

---------

Co-authored-by: Karl Higley <[email protected]>
  • Loading branch information
jperez999 and karlhigley authored Jul 13, 2023
1 parent 2d68307 commit b2af60d
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions merlin/dag/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.
#
import collections.abc
import os
from typing import List, Union

from merlin.dag.operator import Operator
Expand Down Expand Up @@ -446,6 +447,46 @@ def exportable(self, backend: str = None):
backends = getattr(self.op, "exportable_backends", [])
return hasattr(self.op, "export") and backend in backends

def export(
self,
output_path: Union[str, os.PathLike],
node_id: int = None,
version: int = 1,
):
"""
Export a directory for this node, containing the required artifacts
to run in the target context.
Parameters
----------
output_path : Union[str, os.PathLike]
The base path to write this node's export directory.
node_id : int, optional
The id of this node in a larger graph (for disambiguation), by default None.
version : int, optional
The version of the node to use for this export, by default 1.
"""
return self.op.export(
output_path,
self.input_schema,
self.output_schema,
node_id=node_id,
version=version,
)

@property
def export_name(self):
"""
Name for the exported node directory.
Returns
-------
str
Name supplied by this node's operator.
"""
return self.op.export_name

@property
def parents_with_dependencies(self):
nodes = []
Expand Down

0 comments on commit b2af60d

Please sign in to comment.