Best Practices - Amazon SageMaker
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Best Practices

The following sections suggest best practices to follow when you use the @step decorator for your pipeline steps.

Use warm pools

For faster pipeline step runs, use the warm pooling functionality provided for training jobs. You can turn on the warm pool functionality by providing the keep_alive_period_in_seconds argument to the @step decorator as demonstrated in the following snippet:

@step( keep_alive_period_in_seconds=900 )

For more information about warm pools, see Train Using SageMaker Managed Warm Pools.

Structure your directory

You are advised to use code modules while using the @step decorator. Put the pipeline.py module, in which you invoke the step functions and define the pipeline, at the root of the workspace. The recommended structure is shown as follows:

. ├── config.yaml # the configuration file that define the infra settings ├── requirements.txt # dependencies ├── pipeline.py # invoke @step-decorated functions and define the pipeline here ├── steps/ | ├── processing.py | ├── train.py ├── data/ ├── test/