-
Notifications
You must be signed in to change notification settings - Fork 301
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
SageMaker custom types for ParameterRangeOneOf and HyperparameterConfig. TunableParams extraction #189
Conversation
Ping @wild-endeavor @bnsblue |
validation=validation_dataset, | ||
static_hyperparameters=static_hyperparameters, | ||
hyperparameter_tuning_job_config=hyperparameter_tuning_job_config, | ||
num_round=ParameterRangeOneOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it ParameterRangeOneOf
rather than ParameterRange
(which is defined in flytekit.common.tasks.sagemaker.types
https://github.com/lyft/flytekit/pull/189/files#diff-0a303f3854a09b767e67d5f6eb857cbc49a6714f8df987f65646b98c5ef4d194R8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of flytekit.common.tasks.sagemaker.types.ParameterRange
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That (in common.tasks.sagemaker.types) is just the "type" definition.. this is the value...
just like you use Types.String
to define the type of an input but you then use "hello world"
as the value...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see
validation=validation_dataset, | ||
static_hyperparameters=static_hyperparameters, | ||
hyperparameter_tuning_job_config=hyperparameter_tuning_job_config, | ||
num_round=ParameterRangeOneOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is it possible to make this even simpler by getting rid of the ParameterRangeOneOf()
part? For example, Is it possible to make it as simple as num_round=IntegerParameterRange(...)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to... any ideas? @wild-endeavor might have ideas too..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pinging @wild-endeavor ^ please take a look
validation=validation_dataset, | ||
static_hyperparameters=static_hyperparameters, | ||
hyperparameter_tuning_job_config=hyperparameter_tuning_job_config, | ||
num_round=ParameterRangeOneOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I don't think I understand the code so these might just be stupid questions. But when should the user use ParameterRangeOneOf and when should one use ParameterRange?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParameterRange is the type... you use it when you declare the interface of a task/WF... etc...
ParameterRangeOneOf is the value you can set for that type....
We can choose to name them the same but keep them in two different packages... (the flytekit way as far as I understand)...
@wild-endeavor might help shed some light on how to properly do this...
I left some questions and comments. I don't think I understand the code fully so those questions might be stupid. |
I don't have further comments besides I really like the user to be able to write |
Let me try something |
Sure. I was hoping that creating a ParameterRangeBase and letting ParameterRangeOneOf and IntegerParameterRange etc all inherit from it can solve the problem, but I couldn't get it to work. |
@EngHabu Are you done with what you wanted to try? Is that part ready for review? |
|
||
ParameterRange = _sdk_types.Types.GenericProto(_pb2_parameter_ranges.ParameterRangeOneOf) | ||
ParameterRange = _sdk_types.Types.GenericProto(_parameter_range_models.ParameterRangeOneOf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are wrapping a model
instead, should we still call it Generic"Proto"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
models should be thought of as "glorified" protos (or pythonic-protos)... so same assumptions about them should apply...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense
just a nit. LGTM |
…ig. TunableParams extraction (flyteorg#189) Creates custom types for ParameterRangeOneOf and HyperparameterJobConfig. Use generics to serialize/deserialize protos to make UX visualization easier Move tunable hyperparameters out of HyperparameterJobConfig to make it easier to bind (and consistent with Custom Container Training Job) * Typing * ParameterRangeOneOf model * cleanup * lint * lint * unittests * unit * unit * isort * isort * py 3.5 * lint * lint * re-add generic types to protos * lint * Remove generic * remove T * reformat * fix import * PR Comments * lint * lint * PR Comments * PR Comments * lint * unittest * PR Comments * lint * remove deprecated fields * Support converting raw protos through Types.*Proto classes * lint * revert notebook.py * lint
TL;DR
Type
Are all requirements met?
Example:
Tracking Issue
flyteorg/flyte#455