ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
When using decorators when creating a pipeline and components, the return values of the components are stored as artifacts in the respective component task on the ClearML server. We view those via the Web UI. Currently, it is not possible to save metadata with such a return value artifact.
My current workaround is to upload any artifact with Task.current_task().upload_artifact(...) and always return Task.current_task().id. Later, I use the ID to load the artifact (and its metadata). This looks like this:
The information provided my metadata can be seen by my colleagues in the Web UI directly.
Another idea is to have a custom class like
class MyReturnValue:
def __init__(self):
self.mydata = mydata
self.mymetadata = mymetadata
which I could put into another module my_return_value_module and then use that as a return value, along the lines of
@PipelineDecorator.component(repo=".")
def step_one(args):
from my_return_value_module import MyReturnValue
return MyReturnValue(...)
The idea to return a custom class is currently not practical, as the return value would just be saved as a blob and the metadata could not be seen in the Web UI by colleagues or myself.
That being said, maybe we could have such a special return value in the ClearML SDK. If this special value one of the (multiple) return values of a component or pipeline, the ClearML SDK considers the metadata and displays it as it would for a "normal" artifact.
Honestly though, while I think, this would be a cool feature, I do not think that it is the most important feature either ;-). But maybe it is pretty easy to develop (I do not know).
What a cool idea for "decorating" function return values with metadata (excuse the pun 🙂).
We'll consider this as pipeline capabilities are extended.
When using decorators when creating a pipeline and components, the return values of the components are stored as artifacts in the respective component task on the ClearML server. We view those via the Web UI. Currently, it is not possible to save metadata with such a return value artifact.
My current workaround is to upload any artifact with
Task.current_task().upload_artifact(...)
and always returnTask.current_task().id
. Later, I use the ID to load the artifact (and its metadata). This looks like this:The information provided my metadata can be seen by my colleagues in the Web UI directly.
Another idea is to have a custom class like
which I could put into another module
my_return_value_module
and then use that as a return value, along the lines ofThe idea to return a custom class is currently not practical, as the return value would just be saved as a blob and the metadata could not be seen in the Web UI by colleagues or myself.
That being said, maybe we could have such a special return value in the ClearML SDK. If this special value one of the (multiple) return values of a component or pipeline, the ClearML SDK considers the metadata and displays it as it would for a "normal" artifact.
Honestly though, while I think, this would be a cool feature, I do not think that it is the most important feature either ;-). But maybe it is pretty easy to develop (I do not know).