@@ -96,68 +96,6 @@ def generate_request_over_time_data(benchmarks: List[TextGenerationBenchmark]) -
9696 final_result = generate_metric_report (request_distribution , "requestsOverTime" )
9797 return { "numBenchmarks" : len (sorted_benchmarks ), ** final_result }
9898
99- # def generate_request_over_time_data_per_benchmark(benchmarks: List[TextGenerationBenchmark]) -> List[Dict[str, Any]]:
100-
101- # request_over_time_results = []
102- # for benchmark in benchmarks:
103- # # compare benchmark start time to text generation result end time
104- # all_result_end_times = [result.end_time for result in benchmark.results if result.end_time is not None]
105- # request_over_time_values = list(map(lambda time: time - benchmark.start_time, all_result_end_times))
106- # request_distribution = Distribution(data=request_over_time_values)
107- # result = generate_metric_report(request_distribution, "requestsOverTime")
108- # result["requestsPerSecond"] = benchmark.completed_request_rate
109- # request_over_time_results.append(result)
110-
111- # if len(benchmarks) == 1:
112- # return request_over_time_results
113-
114- # request_over_time_raw = []
115- # sorted_bm = sorted(benchmarks, key=lambda bm: bm.completed_request_rate)
116- # for benchmark in sorted_bm:
117- # # compare benchmark start time to text generation result end time
118- # all_result_end_times = [result.end_time for result in benchmark.results if result.end_time is not None]
119- # request_over_time_values = list(map(lambda time: time - benchmark.start_time, all_result_end_times))
120- # request_at_rps = { "rps": benchmark.completed_request_rate, "requests_over_time": request_over_time_values }
121- # request_over_time_raw.append(request_at_rps)
122-
123- # rps_values = [request_obj["rps"] for request_obj in request_over_time_raw]
124- # rps_range = list(range(math.ceil(min(rps_values)), math.ceil(max(rps_values))))
125- # interpolated_request_values = []
126- # lower_rps_index = 0
127- # for rps in rps_range:
128- # if rps > rps_values[lower_rps_index + 1]: lower_rps_index += 1
129- # if rps == rps_values[lower_rps_index]:
130- # interpolated_request_values.append({
131- # "requests_per_second": rps,
132- # "requests_over_time": request_over_time_raw[lower_rps_index]["requests_over_time"][:]
133- # })
134- # lower_rps_index += 1
135- # elif rps < rps_values[lower_rps_index + 1]:
136- # interpolated_requests_at_new_rps = []
137- # for i in range(len(request_over_time_raw[lower_rps_index]["requests_over_time"])):
138- # lower_request = request_over_time_raw[lower_rps_index]["requests_over_time"][i]
139- # upper_request = request_over_time_raw[lower_rps_index + 1]["requests_over_time"][i]
140- # new_value = linearly_interpolate_value(rps, rps_values[lower_rps_index], lower_request, rps_values[lower_rps_index + 1], upper_request)
141- # interpolated_requests_at_new_rps.append(new_value)
142- # interpolated_request_values.append({ "requests_per_second": rps, "requests_over_time": interpolated_requests_at_new_rps })
143- # elif rps > rps_values[lower_rps_index + 1]:
144- # while rps > rps_values[lower_rps_index + 1]:
145- # lower_rps_index += 1
146- # interpolated_requests_at_new_rps = []
147- # for i in range(len(request_over_time_raw[lower_rps_index]["requests_over_time"])):
148- # lower_request = request_over_time_raw[lower_rps_index]["requests_over_time"][i]
149- # upper_request = request_over_time_raw[lower_rps_index + 1]["requests_over_time"][i]
150- # new_value = linearly_interpolate_value(rps, rps_values[lower_rps_index], lower_request, rps_values[lower_rps_index + 1], upper_request)
151- # interpolated_requests_at_new_rps.append(new_value)
152- # interpolated_request_values.append({ "requests_per_second": rps, "requests_over_time": interpolated_requests_at_new_rps })
153- # interpolated_request_over_time_results = []
154- # for request_value in interpolated_request_values:
155- # request_distribution = Distribution(data=request_value["requests_over_time"])
156- # result = generate_metric_report(request_distribution, "requestsOverTime")
157- # result["requestsPerSecond"] = request_value["requests_per_second"]
158- # interpolated_request_over_time_results.append(result)
159- # return { "rawData": request_over_time_results, "interpolatedData": interpolated_request_over_time_results }
160-
16199
162100def generate_workload_details (report : TextGenerationBenchmarkReport , benchmarks : List [TextGenerationBenchmark ]) -> Dict [str , Any ]:
163101 all_prompt_token_data = [data for benchmark in benchmarks for data in benchmark .prompt_token_distribution .data ]
0 commit comments