Support tags in Model.register()
Describe the feature you'd like
Model.register(...) should support adding tags, the same as Model.create(...) and pipelines RegisterModel already do.
How would this feature be used? Please describe.
I've been working with a customer who's registering models from a SageMaker Pipeline, using the PipelineSession syntax and ModelStep(step_args=model.register(...)).
We'd like to tag the package/version in Model Registry with the names of the training job and pipeline execution that generated it, since these seem not recorded automatically and are useful for maintaining lineage.
Describe alternatives you've considered
Without this parameter, it looks like we'll have to drop from ModelStep down to a RegisterModel step, which supports tagging... But the high-level .register() API is used in more samples and would be much preferred!
Additional context
As far as I can tell, the CreateModelPackage API already supports Tags - so I believe it should be no problem in the underlying APIs?
Are there any updates with regard to this feature request? Currently, the lack of a tags parameter forces us to use the RegisterModel step.
SagaMaker Pipeline team checking in.
ModelStep would aggregate the create-model-package API request dict generated by model.register() into the pipeline step definition. I checked that, in Pipeline layer, we do support tagging for model registry. For example, with the step definition like the following, the tag works for resource based allowlist.
Thus, the feature gap is in SDK, to be more specific, the model.register function does not take in the tags argument.
Given the CreateModelPackage API, invoked under the hood, tags attribute does exist.
Hence, passing the feature request to model registry team to evaluate this feature request. If the tags is supported in model.register, it should be automatically integrated with the Pipeline.
"Steps": [
{
"Name": "RegisterModelStep",
"Type": "RegisterModel",
"Arguments":
{
"InferenceSpecification": {
"Containers": [
{
"ContainerHostname": "ModelContainer",
"Image":
{
"Get": "Parameters.ImageURI"
}
}
],
"SupportedContentTypes": [ "text/csv" ],
"SupportedRealtimeInferenceInstanceTypes": [
{
"Get": "Parameters.RealtimeInferenceInstanceType"
}
],
"SupportedResponseMIMETypes": [ "text/csv" ],
"SupportedTransformInstanceTypes": [
{
"Get": "Parameters.TransformInstanceType"
}
]
},
"ModelPackageGroupName": {
"Get": "Parameters.ModelPackageGroupName"
},
"Tags": [
{
"Key": "sagemaker:domain-arn", # <<<<<<<<<<<<<<<
"Value": "someRandomDomainArn" # <<<<<<<<<<<<<<<<<<
}
]
}
}
]
Tags is not supported when providing Model Package Group Name ie registering a model package version https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateModelPackage.html#sagemaker-CreateModelPackage-request-Tags If you want to store key value pair just like tags, you can leverage field customer_metadata_properties which takes key value pairs and you can store pipeline and training excution details in it.