aws / aws/aws-step-functions-data-science-sdk-python

different name for training job inside estimator than step input

オープン
#78 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
299
フォーク
84
PR マージ指標
30日以内にマージされた PR はありません

説明

- sagemaker contrainer : conda_pytorch_p36
- estimator mode : 'script mode'
While it is a MUST param that I have to give a name for `TrainingJobName` from step functions for data science sdk.
```
pytorch_estimator = PyTorch(entry_point='HRC_0818_final.py',
train_instance_type='ml.m4.xlarge',
role=role,
train_instance_count=1,
framework_version='1.4.0',
base_job_name = 'kanto-base-job',
)
```

```
import stepfunctions
training_step = steps.TrainingStep(
'Model Training',
estimator=pytorch_estimator,
data={
'training': s3_input(s3_data=execution_input['TrainTargetLocation'])
} ,
job_name=execution_input['TrainingJobName'],
wait_for_completion=True
)

model_step = steps.ModelStep(
'Save model',
model=training_step.get_expected_model(),
model_name=execution_input['ModelName'] ,
instance_type='ml.m4.xlarge',

)

execution = workflow.execute(
inputs={

'ModelName': 'kanto-mode-{}'.format(uuid.uuid4().hex),
'TrainTargetLocation' : 's3://hrms-train/traindata/train.jsonl'
}
)
```

it is still the default training job name inside the estimator with current `strtime` following` base_job_name`
` "module_dir": "s3://sagemaker-{aws-region}-{aws-id}/{training-job-name}/source/sourcedir.tar.gz",`

Then you link a wrong dir to a Model consequently.
`SAGEMAKER_SUBMIT_DIRECTORY | s3://sagemaker-{aws-region}-{aws-id}/{base-job-name}-2020-08-20-17-47-50-751/source/sourcedir.tar.gz`

I guess the reason is that I have two difference folder for model.tar.gz and sourcedir.tar.gz then leads to a awkward behavior that you can't create consolidated model.tar.gz when you deploy it to server. I can only copy sourcedir.tar.gz to a mms server as this is a default job name. I am missing model.pth consequently.

So, that just leads to put a lambda function that just copies model.tar.gz (model.pth) from TrainTargetLocation folder to default training job folder (strtime named) to make it work correctly.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、TrainingStep が estimator の base_job_name とともに job_name をどのように扱うかを追跡し、次に model.tar.gz と sourcedir.tar.gz のパスがどのように構築されるかを調べます。PyTorch、TrainingStep、ModelStep のスニペットで動作を再現します。training job name とアーティファクトの場所が、報告されている copy workaround なしで一貫していれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, python
領域
cloud, machine-learning
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。