Skip to content

Commit 788892d

Browse files
committed
docs: all four GPU lanes measured; symbol form follows the compiler
CCE OpenMP closes the last cell: s_tvd_rk$m_time_steppers_$ck_L486_16, the same scheme as the OpenACC lane's _ck_L486_6 and differing only in a trailing counter. That overturns the assumption behind the previous comment. The symbol form is set by the COMPILER, not the offload model: CCE emits its own scheme for both acc and mp, while AFAR's Flang form (__omp_offloading_..._QMm_time_steppersPs_tvd_rk_l486) is different again. Reading any two lanes suggests the offload model decides; only all three show otherwise. All carry module, subroutine and line. Also records that the summarizer is now validated against three real reports (14,635/13,826/65,210 lines in, 37/35/36 out) rather than one, and that the stop-PC histogram earns its place most on CCE OpenMP, which halts at seven distinct PCs against four for CCE OpenACC and one for AFAR. Claude-Session: https://claude.ai/code/session_013573Qr8zEMdYLkP4XyVfiy
1 parent d544695 commit 788892d

2 files changed

Lines changed: 49 additions & 6 deletions

File tree

toolchain/mfc/test/test.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -838,12 +838,17 @@ def fault_diagnostic_env(base: dict) -> dict:
838838
# the faulting instruction and per-wave registers -- where no CRAY_ACC_*
839839
# variable names it at all.
840840
#
841-
# gpu-mp is EXPECTED to work but is untested: the agent hooks ROCr, which
842-
# sits below both OpenACC and OpenMP offload, so it should fire either way.
843-
# What is unverified is the attribution, not the firing -- that symbol is
844-
# CCE's OpenACC mangling, and whether module, subroutine and line survive in
845-
# the OpenMP-offload form has never been run. The summarizer does not care
846-
# (its regex takes whatever the symbol is); the claim does.
841+
# Measured on all four lanes. The symbol form is set by the COMPILER, not by
842+
# the offload model -- which is the opposite of what it looks like from any
843+
# two of them:
844+
#
845+
# CCE acc s_tvd_rk$m_time_steppers_$ck_L486_6
846+
# CCE mp s_tvd_rk$m_time_steppers_$ck_L486_16 (same scheme, counter differs)
847+
# AFAR mp __omp_offloading_..._QMm_time_steppersPs_tvd_rk_l486 (Flang)
848+
#
849+
# All three carry module, subroutine and line. The summarizer does not care
850+
# which -- its regex takes whatever the symbol is -- but anything that tries
851+
# to parse the symbol must not assume one scheme per offload model.
847852
#
848853
# Cost on a healthy run: one paired A/B put it at 4.5645 ns/gp/eq/rhs
849854
# against an agent-free spread of 4.5301-4.5614, i.e. 0.07% above a range
@@ -925,6 +930,18 @@ def summarize_rocm_debug_agent(out: str, max_disasm: int = 14) -> str:
925930
all for 65,210 lines of real 7.2.0 output. Hence the tolerant separator, and
926931
reusing is_gpu_memory_fault rather than hardcoding one version's wording.
927932
Both formats are pinned by fixtures below.
933+
934+
Validated against three real reports, not one:
935+
936+
CCE acc ROCm 6.3.1 14,635 lines -> 37
937+
CCE mp ROCm 6.3.1 13,826 lines -> 35
938+
AFAR mp ROCm 7.2.0 65,210 lines -> 36
939+
940+
and output from a run with no agent loaded still yields '', so the fallback
941+
is intact. The stop-PC histogram earns its place most on the CCE OpenMP
942+
lane, which halts at seven distinct PCs (62/21/19/10/10/2/1) against four
943+
for CCE OpenACC and one for AFAR: quoting a single PC would be wrong there
944+
six times in seven.
928945
"""
929946
waves = re.findall(r"^wave_\d+: pc=(0x[0-9a-f]+).*?\(stopped, reason: (\w+)\)", out, re.M)
930947
if not waves:

toolchain/mfc/test/test_gpu_fault_diagnostics.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,29 @@ def test_the_omp_symbol_still_carries_module_procedure_and_line():
394394
assert "_QMm_time_steppers" in summary
395395
assert "Ps_tvd_rk" in summary
396396
assert "_l486" in summary
397+
398+
399+
def test_every_measured_symbol_form_yields_module_procedure_and_line():
400+
"""Three manglings, one per compiler -- not one per offload model.
401+
402+
CCE emits the same scheme for OpenACC and OpenMP offload, differing only in
403+
a trailing counter, while AFAR's Flang form is different again. Reading any
404+
two lanes suggests the offload model picks the mangling; reading all three
405+
shows it is the compiler. Anything that parses these must not assume the
406+
former.
407+
"""
408+
from mfc.test.test import summarize_rocm_debug_agent
409+
410+
lanes = {
411+
"CCE acc": "s_tvd_rk$m_time_steppers_$ck_L486_6",
412+
"CCE mp": "s_tvd_rk$m_time_steppers_$ck_L486_16",
413+
"AFAR mp": "__omp_offloading_8116438_1c00689b__QMm_time_steppersPs_tvd_rk_l486",
414+
}
415+
416+
for lane, symbol in lanes.items():
417+
report = ROCM_AGENT_FIXTURE_631.replace("s_tvd_rk$m_time_steppers_$ck_L486_6", symbol)
418+
summary = summarize_rocm_debug_agent(report)
419+
420+
assert summary, f"{lane}: agent report not recognised"
421+
assert symbol in summary, f"{lane}: symbol lost from the summary"
422+
assert "486" in summary, f"{lane}: source line lost"

0 commit comments

Comments
 (0)