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

Remove ensemble specific code #305

Merged
merged 19 commits into from
Mar 28, 2023

Conversation

oliverholworthy
Copy link
Member

@oliverholworthy oliverholworthy commented Mar 27, 2023

Following the removal of the ensemble runtime export in #255. Further cleanup of methods that are no longer required.

Motivation

  • Make it clearer which operators are required to implement for those creating new or custom operators. Cleaning up unused methods from our operators, will hopefully make them easier to use as a reference and get started creating operators.

Details

One new feature is added by this PR. A save_artifacts method that complements the load_artifacts method. And facilitates the removal of the export methods on all non-Triton operators.

  • Removes OperatorRunner (and corresponding Triton Python Model oprunner_model.py)
    • This has been replaced by the TritonExecutorRuntime (and corresponding Triton Python Model executor_model.py)
    • Removes from_config methods from non-Triton specific operators (this method was called by oprunner_model.py to reload an operator from the Triton model config). This was used when we were exporting each operator as a triton model)
  • Removes unused export methods from non-Triton specific operators.
    • These methods were used when we had the 'ensemble' runtime where each operator exported to their own Triton model
  • Removes exportable_backends from operators
    • We now only have one type of Triton Runtime. Since all the Triton operators require an export method so we know it's exportable if the operator is a TritonOperator.
    • Some non-Triton operators were implementing the export to save non-pickleable objects for reloading. Added a new method called save_artifacts that serves this purpose and is intended to be implemented on any operator that implements load_artifacts.
  • Removes PredictImplicitTriton. The regular PredictImplicit is sufficient now that we have save_artifacts implemented.

@oliverholworthy oliverholworthy added the chore Maintenance for the repository label Mar 27, 2023
@oliverholworthy oliverholworthy added this to the Merlin 23.04 milestone Mar 27, 2023
@oliverholworthy oliverholworthy self-assigned this Mar 27, 2023
@@ -107,6 +67,7 @@ def transform(
"""
return transformable

@abstractmethod
Copy link
Member Author

Choose a reason for hiding this comment

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

This export method of the TritonOperator is now an abstractmethod. Meaning that an operator that inherits from TritonOperator is required to implement the export method.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removing the default implemntation here because it wasn't used. Each Triton Operator is expected to export it's own model config that is specific to the backend/model that is being used.

exportable_node_idx = 0
node_id_lookup = {}
for node in nodes:
if node.exportable(backend):
if isinstance(node.op, TritonOperator):
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need to check the exportable method anymore because every TrtionOperator is expected to implement export to save the operator as a Triton model.

if node_config is not None:
node_configs.append(node_config)

executor_config = self._executor_model_export(path, name, ensemble)
if hasattr(node.op, "save_artifacts"):
node.op.save_artifacts(str(artifact_path))
Copy link
Member Author

Choose a reason for hiding this comment

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

This new method save_artifacts enables any inference operator to save state that can't be pickled, without needing to implement a TritonOperator with a model export. Complements the existing load_artifacts method that is called within the executor_model.py

@github-actions
Copy link

Documentation preview

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance for the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants