aws / aws/aws-step-functions-data-science-sdk-python
different name for training job inside estimator than step input
- Ngôn ngữ chính
- Python
- Star
- 299
- Fork
- 84
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
- 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi cách TrainingStep xử lý job_name cùng với base_job_name của estimator, sau đó kiểm tra cách các đường dẫn của model.tar.gz và sourcedir.tar.gz được tạo. Tái hiện hành vi bằng các snippet PyTorch, TrainingStep và ModelStep; được xem là hoàn tất khi tên training job và vị trí các artifact vẫn nhất quán mà không cần copy workaround đã được báo cáo.
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
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- 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
- 30/100