cerebras.modelzoo.common.utils.run.cli_parser.get_parser#

cerebras.modelzoo.common.utils.run.cli_parser.get_parser(extra_args_parser_fn=None, device_type=None, parser_epilog=None, csx_parser_epilog=None, modes=['train', 'eval', 'train_and_eval', 'eval_all'])[source]#

Returns an ArgumentParser for parsing commandline options.

Parameters
  • extra_args_parser_fn (Optional[Callable[[], List[argparse.ArgumentParser]]]) – Parent parser passed in by models with unique specific arguments.

  • device_type (Optional[cerebras.modelzoo.common.utils.run.utils.DeviceType]) – The device type for which to fetch to add the args to the new parser. If None, all device type (CPU, GPU, CSX) args are added.

  • parser_epilog (Optional[str]) – Optional helpful text to add to the end of the main parser’s help message

  • csx_parser_epilog (Optional[str]) – Optional helpful text to add to the end of the CSX subparser’s help message

  • modes (List[str]) – Optional list of valid modes to be passed under the –mode argument of the parser. We default to choices [“train”, “eval”, “train_and_eval”, “eval_all”]. If an empty list if provided, then –mode isn’t added as a parser arg.

Returns

A parser instance.

Return type

argparse.ArgumentParser