Skip to content

Commit 6063785

Browse files
btian1Chao Song
authored andcommitted
tools: sof_perf_analyzer: change module CPC calculation
Previously, module CPC is calculated by multiplying the mean value of cpu_peak with a margin scalar, after internal technical discussion, change module CPC to the product of maximum value of module's cpu_peak and the margin scalar, and change the margin scalar to 1.1 as aligned. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
1 parent 237048d commit 6063785

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tools/sof_perf_analyzer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
import pandas as pd
2929

30-
# currently, keep CPC = avg_cpu_peak * CPC_MARGIN
31-
CPC_MARGIN = 1.15
30+
# currently, keep CPC = max(module peak) * CPC_MARGIN
31+
CPC_MARGIN = 1.1
3232

3333
@dataclass()
3434
class TraceItem:
@@ -237,8 +237,7 @@ def analyze_perf_info():
237237
perf_stats.columns = ['CPU_AVG(MIN)', 'CPU_AVG(AVG)', 'CPU_AVG(MAX)',
238238
'CPU_PEAK(MIN)', 'CPU_PEAK(AVG)', 'CPU_PEAK(MAX)']
239239
perf_stats['PEAK(MAX)/AVG(AVG)'] = perf_stats['CPU_PEAK(MAX)'] / perf_stats['CPU_AVG(AVG)']
240-
comp_peak_avg_cycles = perf_info.groupby('COMP_ID')['CPU_PEAK'].mean()
241-
perf_stats['MODULE_CPC'] = comp_peak_avg_cycles * CPC_MARGIN
240+
perf_stats['MODULE_CPC'] = perf_info.groupby('COMP_ID')['CPU_PEAK'].max() * CPC_MARGIN
242241
# change data type from float to int
243242
perf_stats['MODULE_CPC'] = perf_stats['MODULE_CPC'].astype(int)
244243

0 commit comments

Comments
 (0)