def _check_for_sagemaker_integration()

in src/sagemaker_training/pytorch_xla.py [0:0]


    def _check_for_sagemaker_integration(self):
        # pylint: disable=no-self-use
        try:
            import torch_xla.distributed.xla_spawn  # pylint: disable=unused-import # noqa: F401
        except ModuleNotFoundError as exception:
            raise errors.SMTrainingCompilerConfigurationError(
                "Unable to find SageMaker integration code in PT-XLA. "
                "AWS SageMaker adds custom code on top of open source "
                "PT-XLA to provide platform specific "
                "optimizations. These SageMaker specific binaries are"
                " shipped as part of our Deep Learning Containers."
                " Please refer to "
                "https://github.com/aws/deep-learning-containers"
                "/blob/master/available_images.md"
            ) from exception