Parse the string into a dictionary with keys being names of SLOS and values being their corresponding values
(slo_pairs)
| 622 | |
| 623 | |
| 624 | def parse_goodput(slo_pairs): |
| 625 | """Parse the string into a dictionary with keys being names of SLOS and values being their corresponding values""" |
| 626 | goodput_config_dict = {} |
| 627 | try: |
| 628 | for slo_pair in slo_pairs: |
| 629 | slo_name, slo_val = slo_pair.split(":") |
| 630 | goodput_config_dict[slo_name] = float(slo_val) |
| 631 | except ValueError as err: |
| 632 | raise argparse.ArgumentTypeError( |
| 633 | "Invalid format found for service level objectives. " |
| 634 | 'Specify service level objectives for goodput as "KEY:VALUE" ' |
| 635 | "pairs, where the key is a metric name, and the value is a " |
| 636 | "number in milliseconds." |
| 637 | ) from err |
| 638 | return goodput_config_dict |
| 639 | |
| 640 | |
| 641 | def save_to_pytorch_benchmark_format(args: argparse.Namespace, results: dict[str, Any], file_name: str) -> None: |
no test coverage detected