MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / parse_goodput

Function parse_goodput

benchmarks/quick_benchmark.py:624–638  ·  view source on GitHub ↗

Parse the string into a dictionary with keys being names of SLOS and values being their corresponding values

(slo_pairs)

Source from the content-addressed store, hash-verified

622
623
624def 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
641def save_to_pytorch_benchmark_format(args: argparse.Namespace, results: dict[str, Any], file_name: str) -> None:

Callers 1

check_goodput_argsFunction · 0.70

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected