Make torchx scheduler opts support enums#870
Make torchx scheduler opts support enums#870andywag wants to merge 1 commit intometa-pytorch:mainfrom
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
Summary: Added Support for Enumerations in scheduler options. This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums. Differential Revision: D55551233
bd12c44 to
820ea58
Compare
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
Summary: Added Support for Enumerations in scheduler options. This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums. Differential Revision: D55551233
820ea58 to
64524dd
Compare
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
1 similar comment
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
Summary: Added Support for Enumerations in scheduler options. This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums. Differential Revision: D55551233
64524dd to
e8715ab
Compare
Summary: Added Support for Enumerations in scheduler options. This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums. Differential Revision: D55551233
e8715ab to
b9573f0
Compare
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
b9573f0 to
aee0801
Compare
Summary: Added Support for Enumerations in scheduler options. This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums. Differential Revision: D55551233
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
Summary: Added Support for Enumerations in scheduler options. This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums. Differential Revision: D55551233
aee0801 to
da0152a
Compare
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
Summary: Added Support for Enumerations in scheduler options. This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums. Differential Revision: D55551233
da0152a to
5e1d68d
Compare
Summary: Added Support for Enumerations in scheduler options. This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums. Differential Revision: D55551233
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
5e1d68d to
4227419
Compare
|
This pull request was exported from Phabricator. Differential Revision: D55551233 |
| opt_type: Type[CfgVal] | ||
| is_required: bool | ||
| help: str | ||
| creator: Optional[Callable[[CfgVal], CfgVal]] = None |
There was a problem hiding this comment.
Its not clear how to use this creator. Can/should I use a creator for a primitive CfgVal (eg ones that are not enums)?
In general schedule options were kept dead simple because they are meant to be directly parsable from command-line (after all torchx is mostly used from CLI). This is why they are not structured, and only basic type checking is done for sanity. Enums are tricky to support especially when the values are sent over the wire and as such support for enums in scheduler opts should be well motivated and thorougly justified as we would be trading off simplicity/clarity for .
I'd like to understand the motivation behind wanting to support enums for scheduler opts before we add them. cc @d4l3k
Summary:
Added Support for Enumerations in scheduler options.
This is a bit more generic as it takes in a creator function which converts a CfgVal to another type. There are some limitations on how general it can be based on how the typing is setup. This also makes it tricky to make a convenience function to handle only Enums.
Differential Revision: D55551233