aws / aws/sagemaker-python-sdk

Respect default_bucket_prefix by default for Estimator code_location

Chiusa
#5,208 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
component: training type: feature request
Lingua principale
Python
Stelle
2.3k
Fork
1.3k
Merge medio
1g 22h
PR unite (30g)
35

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia in src/sagemaker/estimator.py, in _stage_user_code_in_s3, quindi esamina la documentazione collegata di Estimator e Session e i riferimenti a ModelStep/repack_model_step_settings. Il lavoro è completato quando la posizione predefinita del codice usa default_bucket_prefix nelle condizioni indicate per il percorso di output, con la configurazione documentata se la modifica del codice non è possibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, python
Ambito
cloud, machine-learning
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.