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

Function check_goodput_args

benchmarks/quick_benchmark.py:601–621  ·  view source on GitHub ↗

Check whether the given argument has valid goodput configuration or not

(args)

Source from the content-addressed store, hash-verified

599
600
601def check_goodput_args(args):
602 """Check whether the given argument has valid goodput configuration or not"""
603 # Check and parse goodput arguments
604 goodput_config_dict = {}
605 VALID_NAMES = ["ttft", "tpot", "e2el"]
606 if args.goodput:
607 goodput_config_dict = parse_goodput(args.goodput)
608 for slo_name, slo_val in goodput_config_dict.items():
609 if slo_name not in VALID_NAMES:
610 raise ValueError(
611 f"Invalid metric name found, {slo_name}: {slo_val}. "
612 "The service level objective name should be one of "
613 f"{VALID_NAMES!s}. "
614 )
615 if slo_val < 0:
616 raise ValueError(
617 f"Invalid value found, {slo_name}: {slo_val}. "
618 "The service level objective value should be "
619 "non-negative."
620 )
621 return goodput_config_dict
622
623
624def parse_goodput(slo_pairs):

Callers 1

mainFunction · 0.70

Calls 2

itemsMethod · 0.80
parse_goodputFunction · 0.70

Tested by

no test coverage detected