-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow customizing repack model step model output S3 URI #4218
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
Comments
I noticed that it is possible to change the
The model artifact produced by the repack step will be uploaded to:
However, then it will also create some additional bloat in that same bucket since it will also upload the
Anyways, why should the repack step output be controlled by the |
facing the same challenge |
Hi @l3ku, Thanks for using SageMaker and taking the time to suggest ways to improve SageMaker Python SDK. We have added your feature request it to our backlog of feature requests and may consider putting it into future SDK versions. I will go ahead and close the issue now, please let me know if you have any more feedback. Let me know if you have any other questions. Best, |
Hi @l3ku, this feature request was released in v2.204.0. After upgrading the SDK version, to customize the repack model step, you can use the newly added Below is an example on how to use it:
|
Describe the feature you'd like
I am training a HuggingFace estimator in a SageMaker pipeline and registering the model in model registry with a custom inference entrypoint. It seems that the HuggingFace model sets
repack=True
in theprepare_container_def
when it uploads the code usingself._upload_code
:https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/huggingface/model.py#L498
It seems that there is no way to customize the S3 URI where the model produced during the repack step will be stored, other than by setting the default SageMaker bucket and key prefix to some value initially. Ideally, I would like to overwrite the model artifact from the previous training step, which is currently impossible since the S3 URI depends on the training job name.
So currently what happens, is when I provide the output path to the estimator during training:
SageMaker pipelines will store the training job model artifact at:
The repack step (training job) will store the repacked model artifacts at:
I am using a centralized S3 bucket intended only for model artifacts (MODEL_ARTIFACT_BUCKET_NAME), hence I would only want to store the model artifacts there and not any uploaded code or other scripts that would eventually end up there if I would use the bucket as the default SageMaker session bucket. Hence the request for the feature to customize only the S3 URI of the repacked model artifacts.
How would this feature be used? Please describe.
The repack step would either use the same model artifacts S3 URI as the previous training step, or it would be possible to provide the output S3 URI of the repacked model artifact either in the constructor of
HuggingFaceModel
or in theregister()
method.Describe alternatives you've considered
No alternatives at the moment.
Additional context
The text was updated successfully, but these errors were encountered: