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)
- 主要言語
- Python
- スター
- 2.3k
- フォーク
- 1.3k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 35
説明
**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
コントリビューションガイド
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- aws, python
- 領域
- cloud, machine-learning
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100