MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / handle_benchmark

Function handle_benchmark

python/paddle_serving_server/parse_profile.py:40–72  ·  view source on GitHub ↗
(benchmark_config, benchmark_raw, indentifier)

Source from the content-addressed store, hash-verified

38 self.fstr += new_str + "\n"
39
40def handle_benchmark(benchmark_config, benchmark_raw, indentifier):
41 model_info = {
42 'model_name': benchmark_config["model_name"],
43 'precision': benchmark_config["precision"]
44 }
45 data_info = {
46 'batch_size': benchmark_config["batch_size"],
47 'shape': benchmark_config["input_shape"],
48 'data_num': benchmark_config["num_of_samples"]
49 }
50 perf_info = {
51 'preprocess_time_s': "",
52 'inference_time_s': float(benchmark_raw["median"][0:-2])/1000, # *** ms
53 'postprocess_time_s': "",
54 'total_time_s': "",
55 'inference_time_s_90': float(benchmark_raw["90_percent"][0:-2])/1000, # *** ms
56 'inference_time_s_99': float(benchmark_raw["99_percent"][0:-2])/1000, # *** ms
57 'qps': benchmark_raw["AVG_QPS"]
58 }
59 resource_info = {
60 'cpu_rss_mb': "",
61 'cpu_vms_mb': "",
62 'cpu_shared_mb': "",
63 'cpu_dirty_mb': "",
64 'cpu_util': benchmark_raw["CPU_UTIL"],
65 'gpu_rss_mb': "",
66 'gpu_util': benchmark_raw["GPU_UTIL"],
67 'gpu_mem_util': benchmark_raw["GPU_MEM"]
68 }
69
70 server_log = PaddleInferBenchmark(
71 benchmark_config, model_info, data_info, perf_info, resource_info)
72 server_log(indentifier)
73
74def parse_args(): # pylint: disable=doc-string-missing
75 parser = argparse.ArgumentParser("serve")

Callers 1

parse_profile.pyFile · 0.85

Calls 1

Tested by

no test coverage detected