

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 단계 캐싱 비활성화
<a name="pipelines-caching-disabling"></a>

단계 유형 [파이프라인 단계 유형별 기본 캐시 키 속성](pipelines-default-keys.md)에 나열되지 않은 속성을 변경해도 파이프라인 단계는 재실행되지 않습니다. 하지만 어쨌든 파이프라인 단계를 다시 실행하기로 결정할 수도 있습니다. 이 경우 단계 캐싱을 비활성화해야 합니다.

단계 캐싱을 비활성화하려면 다음 코드 스니펫과 같이 단계 정의의 `CacheConfig`단계 정의 속성에 있는 `Enabled`속성을 `false`로 설정합니다.

```
{
    "CacheConfig": {
        "Enabled": false,
        "ExpireAfter": "<time>"
    }
}
```

참고로, `Enabled`가 `false`인 경우 `ExpireAfter`속성은 무시됩니다.

Amazon SageMaker Python SDK를 사용하여 파이프라인 단계의 캐싱을 해제하려면 파이프라인 단계의 파이프라인을 정의하고 `enable_caching`속성을 비활성화한 다음 파이프라인을 업데이트하세요.

다시 실행하면 다음 코드 예제가 훈련 단계에 대한 캐싱을 해제합니다.

```
from sagemaker.workflow.pipeline_context import PipelineSession
from sagemaker.workflow.steps import CacheConfig
from sagemaker.workflow.pipeline import Pipeline

cache_config = CacheConfig(enable_caching=False, expire_after="PT1H")
estimator = Estimator(..., sagemaker_session=PipelineSession())

step_train = TrainingStep(
    name="TrainAbaloneModel",
    step_args=estimator.fit(inputs=inputs),
    cache_config=cache_config
)

# define pipeline
pipeline = Pipeline(
    steps=[step_train]
)

# update the pipeline
pipeline.update()
# or, call upsert() to update the pipeline
# pipeline.upsert()
```

또는 파이프라인을 이미 정의한 후 `enable_caching`속성을 비활성화하면 한 번의 연속 코드 실행이 가능합니다. 다음 코드 샘플은 이 방법을 보여줍니다.

```
# turn off caching for the training step
pipeline.steps[0].cache_config.enable_caching = False

# update the pipeline
pipeline.update()
# or, call upsert() to update the pipeline
# pipeline.upsert()
```

Python SDK 파라미터가 캐싱에 미치는 영향에 대한 자세한 코드 예제와 설명은 Amazon SageMaker Python SDK 설명서의 [캐싱 구성](https://sagemaker.readthedocs.io/en/stable/amazon_sagemaker_model_building_pipeline.html#caching-configuration)을 참조하세요.