-
Notifications
You must be signed in to change notification settings - Fork 146
Description
Description
Consolidate redundant names, classes, and arguments that represent scheduler RunConfig
.
Motivation/Background
Currently there are different names for what essentially ends up being the additional runtime options for the torchx.scheduler
(see dryrun(..., cfg: RunConfig))
.
This runconfig is:
- has class type
torchx.specs.api.RunConfig
(dataclass) - function argument name
cfg
orruncfg
in most places in the scheduler and runner source code - passed from the
torchx run
cli as--scheduler_args
Additionally each scheduler has what is called a runopts
, which are the runconfig options that the scheduler advertises and takes (see runopts for local_scheduler).
The difference between RunConfig
and runopts
is that the RunConfig
object is simply a holder for the user-provided config key-value pairs while runopts
is the schema (type, default, is_required, help string) of the configs that it takes. Think of runopts
being the argparse.ArgumentParser
of the Scheduler if it were a cli tool, and RunConfig
the sys.argv[1:]
(but instead of an array it is a map).
Detailed Proposal
The proposal is to clean up the nomenclature as follows:
- Deprecate
--scheduler_args
option in torchx cli and instead call it--cfg
(consistent with the parameter names in the Scheduler API). - Change the section name In the runner INI config files from
[$profile.scheduler_args.$sched_name]
to[$profile.$scheduler_name.cfg]
(e.g.[default.scheduler_args.local_cwd]
would become[default.local_cwd.cfg]
) - Rename
Runopt
torunopt
(to be consistant withrunopts
which is a holder for runopt by name)
Alternatives
(not really an alternative but other deeper cleanups considered)
- changing the
cfg
parameter name in Scheduler and Runner interfaces to berunconfig
(consistent withRunConfig
) or alternatively changingRunConfig
toRunCfg
. This is going to be a huge codemod, hence I've decided to live with it and change the rest of the settings to matchcfg
. RunConfig
is simply a wrapper around a regular pythonDict[str, ConfigValue]
(ConfigValue
is a type alias not an actual class) and does not provide any additional functionality on top of the dict other than a prettyprint__repr__()
. Considering just dropping theRunConfig
dataclass and usingDict[str, ConfigValue]
directly (also requires a huge codemod)
Additional context/links
See hyperlinks above.