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(
229229
230230 elif method == "forward" :
231231 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)"
237233 benchmark_result ["actualValue" ] = metric_value * 1000
238234
239235 elif metric_name == "Memory Peak Physical, kB" :
240236 # NB: Showing the value in mB is friendlier IMO
241237 benchmark_result ["metric" ] = "peak_inference_mem_usage(mb)"
242238 benchmark_result ["actualValue" ] = metric_value / 1024
243239
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
247248
248249 return benchmark_result
249250
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ @implementation LLaMATests
8282 return ;
8383 }
8484 TokensPerSecondMetric *tokensPerSecondMetric = [TokensPerSecondMetric new ];
85- [testCase measureWithMetrics: @[ tokensPerSecondMetric, [XCTMemoryMetric new ] ]
85+ [testCase measureWithMetrics: @[ tokensPerSecondMetric, [XCTClockMetric new ], [ XCTMemoryMetric new ] ]
8686 block: ^{
8787 tokensPerSecondMetric.tokenCount = 0 ;
8888 const auto status = runner->generate (
You can’t perform that action at this time.
0 commit comments