diff --git a/src/sagemaker/utils.py b/src/sagemaker/utils.py index 387bdf5da4..af01ab3c92 100644 --- a/src/sagemaker/utils.py +++ b/src/sagemaker/utils.py @@ -1407,7 +1407,9 @@ def volume_size_supported(instance_type: str) -> bool: try: # local mode does not support volume size - if instance_type.startswith("local"): + # instance type given as pipeline parameter does not support volume size + # do not change the if statement order below. + if is_pipeline_variable(instance_type) or instance_type.startswith("local"): return False parts: List[str] = instance_type.split(".") diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index c47947f338..77ea1eb9e2 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -1703,6 +1703,7 @@ def test_volume_size_not_supported(self): "g5.8xlarge", "local", "local_gpu", + ParameterString(name="InstanceType", default_value="ml.m4.xlarge"), ] for instance in instances_that_dont_support_volume_size: