Parse the string into a dictionary with keys being names of SLOS and values being their corresponding values
(slo_pairs)
| 994 | |
| 995 | |
| 996 | def parse_goodput(slo_pairs): |
| 997 | """Parse the string into a dictionary with keys being names of SLOS and values being their corresponding values""" |
| 998 | goodput_config_dict = {} |
| 999 | try: |
| 1000 | for slo_pair in slo_pairs: |
| 1001 | slo_name, slo_val = slo_pair.split(":") |
| 1002 | goodput_config_dict[slo_name] = float(slo_val) |
| 1003 | except ValueError as err: |
| 1004 | raise argparse.ArgumentTypeError( |
| 1005 | "Invalid format found for service level objectives. " |
| 1006 | 'Specify service level objectives for goodput as "KEY:VALUE" ' |
| 1007 | "pairs, where the key is a metric name, and the value is a " |
| 1008 | "number in milliseconds." |
| 1009 | ) from err |
| 1010 | return goodput_config_dict |
| 1011 | |
| 1012 | |
| 1013 | def save_to_pytorch_benchmark_format(args: argparse.Namespace, results: dict[str, Any], file_name: str) -> None: |
no test coverage detected