Skip to content

Commit af837ae

Browse files
fix: skip intelligent volume_size allocation based on instance type if it is a pipeline parameter (#3972)
* fix: skip intelligent volume_size allocation based on instance type if it is a pipeline parameter * fix: Change the order of the if statement check.
1 parent da1eb54 commit af837ae

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/sagemaker/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,9 @@ def volume_size_supported(instance_type: str) -> bool:
14071407
try:
14081408

14091409
# local mode does not support volume size
1410-
if instance_type.startswith("local"):
1410+
# instance type given as pipeline parameter does not support volume size
1411+
# do not change the if statement order below.
1412+
if is_pipeline_variable(instance_type) or instance_type.startswith("local"):
14111413
return False
14121414

14131415
parts: List[str] = instance_type.split(".")

tests/unit/test_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,7 @@ def test_volume_size_not_supported(self):
17031703
"g5.8xlarge",
17041704
"local",
17051705
"local_gpu",
1706+
ParameterString(name="InstanceType", default_value="ml.m4.xlarge"),
17061707
]
17071708

17081709
for instance in instances_that_dont_support_volume_size:

0 commit comments

Comments
 (0)