File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
extension/benchmark/apple/Benchmark/Tests/LLaMA Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -229,21 +229,22 @@ def extract_ios_metric(
229
229
230
230
elif method == "forward" :
231
231
if metric_name == "Clock Monotonic Time, s" :
232
- benchmark_result ["metric" ] = (
233
- "generate_time(ms)"
234
- if "llama" in test_name
235
- else "avg_inference_latency(ms)"
236
- )
232
+ benchmark_result ["metric" ] = "avg_inference_latency(ms)"
237
233
benchmark_result ["actualValue" ] = metric_value * 1000
238
234
239
235
elif metric_name == "Memory Peak Physical, kB" :
240
236
# NB: Showing the value in mB is friendlier IMO
241
237
benchmark_result ["metric" ] = "peak_inference_mem_usage(mb)"
242
238
benchmark_result ["actualValue" ] = metric_value / 1024
243
239
244
- elif method == "generate" and metric_name == "Tokens Per Second, t/s" :
245
- benchmark_result ["metric" ] = "token_per_sec"
246
- benchmark_result ["actualValue" ] = metric_value
240
+ elif method == "generate" :
241
+ if metric_name == "Clock Monotonic Time, s" :
242
+ benchmark_result ["metric" ] = "generate_time(ms)"
243
+ benchmark_result ["actualValue" ] = metric_value * 1000
244
+
245
+ elif metric_name == "Tokens Per Second, t/s" :
246
+ benchmark_result ["metric" ] = "token_per_sec"
247
+ benchmark_result ["actualValue" ] = metric_value
247
248
248
249
return benchmark_result
249
250
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ @implementation LLaMATests
82
82
return ;
83
83
}
84
84
TokensPerSecondMetric *tokensPerSecondMetric = [TokensPerSecondMetric new ];
85
- [testCase measureWithMetrics: @[ tokensPerSecondMetric, [XCTMemoryMetric new ] ]
85
+ [testCase measureWithMetrics: @[ tokensPerSecondMetric, [XCTClockMetric new ], [ XCTMemoryMetric new ] ]
86
86
block: ^{
87
87
tokensPerSecondMetric.tokenCount = 0 ;
88
88
const auto status = runner->generate (
You can’t perform that action at this time.
0 commit comments