Skip to content

fix: trn1 instance family does not support volume size #4828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sagemaker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,7 @@ def volume_size_supported(instance_type: str) -> bool:
and not family.startswith("g5")
and not family.startswith("g6")
and not family.startswith("p5")
and not family.startswith("trn1")
Copy link

@yusharon yusharon Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsupported_families = ["g5", "g6", "p5", "trn1"]
return not any(family.startswith(prefix) for prefix in unsupported_families)

not a blocker, but I think it might be more concise to write it as above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, i agree that that's def a better organization

)
except Exception as e:
raise ValueError(f"Failed to parse instance type '{instance_type}': {str(e)}")
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,8 @@ def test_volume_size_not_supported(self):
"local",
"local_gpu",
ParameterString(name="InstanceType", default_value="ml.m4.xlarge"),
"ml.trn1.32xlarge",
"ml.trn1n.32xlarge",
]

for instance in instances_that_dont_support_volume_size:
Expand Down
Loading