aws / aws/sagemaker-python-sdk

Respect default_bucket_prefix by default for Estimator code_location

クローズ
#5,208 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
component: training type: feature request
主要言語
Python
スター
2.3k
フォーク
1.3k
平均マージ
1日 22時間
マージ済み PR(30日)
35

説明

**Describe the feature you'd like**
Currently the `code_location` attribute of the Estimator class defaults to using the `output_bucket` parameter [docs link](https://sagemaker.readthedocs.io/en/stable/api/training/estimators.html#sagemaker.estimator.EstimatorBase):

> If not specified, the default code location is ‘s3://output_bucket/job-name/’.

The [Session object also has a parameter](https://sagemaker.readthedocs.io/en/stable/api/utility/session.html#sagemaker.session.Session) `default_bucket_prefix` that can be configured.

Ideally, if
1. The `output_bucket` part of `output_path` is the `default_bucket`
2. `_is_output_path_set_from_default_bucket_and_prefix` is False

Then the default location should respect both the `default_bucket` as well as the `default_bucket_prefix`.

e.g. `s3://default_bucket/default_bucket_prefix/job-name/`

This change would be implemented in [_stage_user_code_in_s3](https://github.com/aws/sagemaker-python-sdk/blob/23109671f6262269ab54cdd9aeb5ebe4ea640d25/src/sagemaker/estimator.py#L1042).

Otherwise, the default behavior creates artifacts at the root of the bucket. This means that default behavior for environments where IAM bucket write access is limited by prefix (i.e. SageMaker Unified Studio) will fail.

**How would this feature be used? Please describe.**
If this behavior is implemented, model code assets would be uploaded by default to a prefix where write access is allowed.

**Describe alternatives you've considered**
Currently `code_location` needs to be manually configured to work in SageMaker Unified Studio. This is poorly documented as part of features like [ModelStep](https://sagemaker.readthedocs.io/en/stable/workflows/pipelines/sagemaker.workflow.pipelines.html#sagemaker.workflow.model_step.ModelStep) where it needs to be configured in `repack_model_step_settings` as the model.register output populates `output_path` by default in a pipeline.

If this change cannot be implemented in code, explicit documentation should be provided about configuring parameters to output code in the SageMaker Unified Studio project prefix.

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

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

調査の方向性

src/sagemaker/estimator.py の _stage_user_code_in_s3 から始め、リンクされている Estimator と Session のドキュメント、および ModelStep/repack_model_step_settings の参照を確認します。出力パスについて記載された条件下で、デフォルトのコードの場所が default_bucket_prefix を使用し、コードの変更が不可能な場合は設定方法がドキュメント化されていれば完了です。

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

評価

技術スタック
aws, python
領域
cloud, machine-learning
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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