Skip to content
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

Remove magic strings for attributes like instance type #164

Open
vishwakaria opened this issue Dec 5, 2022 · 0 comments
Open

Remove magic strings for attributes like instance type #164

vishwakaria opened this issue Dec 5, 2022 · 0 comments

Comments

@vishwakaria
Copy link
Contributor

Describe the feature you'd like
The Sagemaker training toolkit and Python SDK use string literals for attribute values in many places. For instance, SMDDP is supported on P3, P3dn and P4D instances at the moment, and these are used as strings in tests and validation.
Code references:

  1. Hardcoding default parameter values
  2. Test parameters
  3. Comments

If we want to deprecate support for an instance type, or add new instances for some features, we need to manually update all references here and in the SDK, potentially introducing bugs.

One solution is to maintain a central config or constants file with name mappings like SM_INSTANCE_NAME_P4D ='ml.p4d.24xlarge'; and then another central mapping for SUPPORTED_INSTANCE_TYPES_SMDDP, SUPPORTED_INSTANCE_TYPES_EFA, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant