aws / aws/sagemaker-python-sdk

Support batch transform job for Model entity with container definitions which use ModelDataSource attribute (especially autogluon foundation jump start model)

Đang mở
#5,160 0 bình luận 3 reaction 0 người được giao Xem trên GitHub
component: jumpstart type: feature request
Ngôn ngữ chính
Python
Star
2.3k
Fork
1.3k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
35

Mô tả

**Describe the feature you'd like**
I would like to support batch transform job for Model entity with container definitions which use ModelDataSource attribute. I am particularly interested in supporting the jump start foundation autogluon chronos model, but it seems that the problem is broader and affects all models, with container definitions which use ModelDataSource attribute (and have not defined "ModelDataUrl" attribute)

**How would this feature be used? Please describe.**
I would expect that below code will create properly batch transform job for autogluon chronos model.
```python
from sagemaker.jumpstart.model import JumpStartModel
model = JumpStartModel(model_id='autogluon-forecasting-chronos-t5-base')
transformer = model.transformer(instance_type='ml.m5.large', instance_count=1)
transformer.transform('s3://some-bucket/')
```
Currently the above code returns the below error suggesting that for some reason models that use container deifinitions which use "ModelDataSource" (and probably transform batch job expect "ModelDataUrl") are not supported by Batch transform job.
```
ClientError: An error occurred (ValidationException) when calling the CreateTransformJob operation: SageMaker Batch
currently doesn't support Model entity with container definitions which use ModelDataSource attribute
```
**Describe alternatives you've considered**
Nothing

**Additional context**
I found the workaround to the problem by gzipping the autogluon forecasting chronos model, and define model by providing model_data in compressed form. Then the ModelDataUrl attribute of container is defined and the batch transform job can be created properly. For some reason when model_data is not provided in gzipped form the ModelDataUrl container attribute is not defined and there does not seem to be any tools to define this attribute manually.

I don't know where exactly the problem lies, whether in the fact that in the case of non-gzipped models the ModelDataUrl container attribute is undefined, or in the fact that the batch transformer job cannot properly copy model files that are not compressed for some reason. Either way, it seems that it could be easy resolved on aws side.

The easiest solution to the problem is to prepare all jump start models in gzipped form, but it is probably better to solve the problem more broadly so that the batch transform job can support models that have not been gzipped.

It is related to the issue: https://github.com/aws/sagemaker-python-sdk/issues/4777

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reproducing the JumpStartModel transformer.transform flow for autogluon-forecasting-chronos-t5-base and inspect the CreateTransformJob request involving ModelDataSource and ModelDataUrl. Read related issue #4777 and confirm what changes are possible in the SDK versus the SageMaker service; done means the example creates a batch transform job without gzipping model data.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
aws, python
Lĩnh vực
cloud, machine-learning
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.