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

Function parse_goodput

benchmarks/benchmark_serving.py:996–1010  ·  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

994
995
996def 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
1013def 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