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

Function check_goodput_args

benchmarks/benchmark_serving.py:973–993  ·  view source on GitHub ↗

Check whether the given argument has valid goodput configuration or not

(args)

Source from the content-addressed store, hash-verified

971
972
973def check_goodput_args(args):
974 """Check whether the given argument has valid goodput configuration or not"""
975 # Check and parse goodput arguments
976 goodput_config_dict = {}
977 VALID_NAMES = ["ttft", "tpot", "e2el"]
978 if args.goodput:
979 goodput_config_dict = parse_goodput(args.goodput)
980 for slo_name, slo_val in goodput_config_dict.items():
981 if slo_name not in VALID_NAMES:
982 raise ValueError(
983 f"Invalid metric name found, {slo_name}: {slo_val}. "
984 "The service level objective name should be one of "
985 f"{VALID_NAMES!s}. "
986 )
987 if slo_val < 0:
988 raise ValueError(
989 f"Invalid value found, {slo_name}: {slo_val}. "
990 "The service level objective value should be "
991 "non-negative."
992 )
993 return goodput_config_dict
994
995
996def parse_goodput(slo_pairs):

Callers 2

benchmark_metricsFunction · 0.70
mainFunction · 0.70

Calls 2

itemsMethod · 0.80
parse_goodputFunction · 0.70

Tested by

no test coverage detected