Skip to content

Commit 07465d8

Browse files
Rename CMN memory bandwidth metric to reflect read+write
Summary: Rename CMN Memory Read Bandwidth to CMN Memory Bandwidth since the underlying CMN event hns_mc_reqs_local_all counts both read and write requests to the memory controller. CMN-Cypress does not distinguish read vs write MC requests in this event, so the previous "Read" label was misleading. Differential Revision: D102244354
1 parent de9deb4 commit 07465d8

2 files changed

Lines changed: 34 additions & 7 deletions

File tree

perfutils/collect_neoversev3_perf_counters.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ for cmn_dev in $(find /sys/bus/event_source/devices/ -maxdepth 1 -name 'arm_cmn_
138138
CMN_SLC_EVENTS+="${cmn_dev}/hns_cache_fill_all/,"
139139
CMN_SLC_EVENTS+="${cmn_dev}/hns_mc_reqs_local_all/,"
140140
CMN_SLC_EVENTS+="${cmn_dev}/hns_pocq_reqs_recvd_all/,"
141+
CMN_SLC_EVENTS+="${cmn_dev}/hns_qos_pocq_occupancy_read/,"
142+
CMN_SLC_EVENTS+="${cmn_dev}/dtc_cycles/,"
141143
done
142144
CMN_SLC_EVENTS="${CMN_SLC_EVENTS%,}"
143145

perfutils/generate_arm_neoversev3_perf_report.py

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -807,23 +807,47 @@ def dispatch_stall_mcq(grouped_df):
807807

808808

809809
@skip_if_missing
810-
def cmn_mem_read_bw_MBps(grouped_df):
811-
"""Memory read bandwidth from CMN MC request counters.
810+
def cmn_mem_bw_MBps(grouped_df):
811+
"""Memory bandwidth (read+write) from CMN MC request counters.
812812
813-
Each hns_mc_reqs_local_all is a cache-line (64B) request to the memory
814-
controller, analogous to Grace's SCF cmem_rd_data.
813+
hns_mc_reqs_local_all counts all cache-line (64B) requests to the memory
814+
controller, including both reads and writes. CMN-Cypress does not
815+
distinguish read vs write MC requests in this event.
815816
"""
816817
mc_reqs = _sum_cmn_event(grouped_df, "hns_mc_reqs_local_all")
817818
dur = get_duration_series(grouped_df.get_group("instructions"))
818819
mc_reqs.index = dur.index
819820
bw_series = (mc_reqs * 64).div(dur)
820821
return {
821-
"name": "CMN Memory Read Bandwidth (MBps)",
822+
"name": "CMN Memory Bandwidth (MBps)",
822823
"series": bw_series,
823824
"prefix": 10**-6,
824825
}
825826

826827

828+
@skip_if_missing
829+
def cmn_mesh_freq_ghz(grouped_df):
830+
"""CMN mesh clock frequency derived from dtc_cycles per CMN instance."""
831+
dur = get_duration_series(grouped_df.get_group("instructions"))
832+
833+
freqs = []
834+
for name, group in grouped_df:
835+
if isinstance(name, str) and name.endswith("/dtc_cycles/"):
836+
cyc = group.counter_value.reset_index(drop=True)
837+
cyc.index = dur.index
838+
freqs.append(cyc / dur)
839+
840+
if not freqs:
841+
raise KeyError("dtc_cycles")
842+
843+
avg_freq = functools.reduce(lambda a, b: a + b, freqs) / len(freqs)
844+
return {
845+
"name": "CMN Mesh Frequency (GHz)",
846+
"series": avg_freq,
847+
"prefix": 10**-9,
848+
}
849+
850+
827851
@skip_if_missing
828852
def sve_pred_empty_pct(grouped_df):
829853
"""SVE predicated ops with no active lanes (wasted work)."""
@@ -960,8 +984,9 @@ def main(
960984
sve_pred_empty_pct(grouped_df),
961985
sve_pred_full_pct(grouped_df),
962986
sve_pred_partial_pct(grouped_df),
963-
# --- CMN uncore (SLC / memory bandwidth) ---
964-
cmn_mem_read_bw_MBps(grouped_df),
987+
# --- CMN memory metrics ---
988+
cmn_mem_bw_MBps(grouped_df),
989+
cmn_mesh_freq_ghz(grouped_df),
965990
]
966991

967992
filtered_metrics = list(itertools.filterfalse(lambda x: x is None, metrics))

0 commit comments

Comments
 (0)