Skip to content

Commit af73f8e

Browse files
committed
Add both load and inference memory usage
1 parent 37a00ca commit af73f8e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/scripts/extract_benchmark_results.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,15 @@ def extract_ios_metric(
208208

209209
# NB: This looks brittle, but unless we can return iOS benchmark results in JSON
210210
# format by the test, the mapping is needed to match with Android test
211-
if method == "load" and metric_name == "Clock Monotonic Time, s":
212-
benchmark_result["metric"] = "model_load_time(ms)"
213-
benchmark_result["actualValue"] = metric_value * 1000
211+
if method == "load":
212+
if metric_name == "Clock Monotonic Time, s":
213+
benchmark_result["metric"] = "model_load_time(ms)"
214+
benchmark_result["actualValue"] = metric_value * 1000
215+
216+
elif metric_name == "Memory Peak Physical, kB":
217+
# NB: Showing the value in mB is friendlier IMO
218+
benchmark_result["metric"] = "peak_load_mem_usage(mb)"
219+
benchmark_result["actualValue"] = metric_value / 1024
214220

215221
elif method == "forward":
216222
if metric_name == "Clock Monotonic Time, s":
@@ -223,7 +229,7 @@ def extract_ios_metric(
223229

224230
elif metric_name == "Memory Peak Physical, kB":
225231
# NB: Showing the value in mB is friendlier IMO
226-
benchmark_result["metric"] = "peak_mem_usage(mb)"
232+
benchmark_result["metric"] = "peak_inference_mem_usage(mb)"
227233
benchmark_result["actualValue"] = metric_value / 1024
228234

229235
elif method == "generate" and metric_name == "Tokens Per Second, t/s":

0 commit comments

Comments
 (0)