Skip to content

Fix profiler and TAU harness checks - #181

Open
dannybaths wants to merge 1 commit into
amd:mainfrom
dannybaths:aac7-profiler-tau-harness-fixes
Open

Fix profiler and TAU harness checks#181
dannybaths wants to merge 1 commit into
amd:mainfrom
dannybaths:aac7-profiler-tau-harness-fixes

Conversation

@dannybaths

Copy link
Copy Markdown

Summary

This PR fixes several profiler and TAU test harness issues found while validating the AAC7 OpenMPI row.

  • Profiler tests now assert produced artifacts instead of matching fragile tool output, and the
    corresponding CTest pass expressions are updated to match.
  • TAU checks now fail on build failure and assert real profile/trace artifacts.
  • TAU and Jacobi MPI detection now query the active MPI wrapper instead of checking whether ompi_info
    exists somewhere on PATH.
  • Jacobi-based TAU launches avoid placing ranks on nodes that cannot see the node-local build
    directory.
  • The PyTorch rocprof-compute run checks the dependency pins that analyze enforces before profiling,
    and the rocprof-compute tests fail immediately, with the reason, when Python is older than 3.10.
    These are reported as failures rather than skips deliberately, so the failure count is not quietly
    reduced.

Why

Several tests could pass or fail for the wrong reason:

  • Some pass regexes matched diagnostic text printed on failure. profile.0 is a substring of
    Could not open profile.0.0.0, and proto appears in output the tool prints when it produces
    nothing.
  • One TAU script continued after make failed, so the final verdict depended only on regex output.
    Because PASS_REGULAR_EXPRESSION overrides the exit code, the script and the CMake criteria had to
    be fixed together.
  • MPI detection confused mixed environments where OpenMPI's ompi_info was visible but mpic++ had
    been replaced by MPICH wrappers.
  • The PyTorch profiling run spent about 25 minutes profiling before reaching an analyze step that
    could not run, turning a dependency problem into a timeout that named no cause.

Validation

Validated on AAC7 with the OpenMPI PrgEnv row: MI300A, ROCm 7.14.0, OpenMPI 5.0.10 over OFI/CXI.

  • The six tests whose pass criteria this PR rewrites were run against these exact changes and all
    pass: Rocprof-sys_ROCm_Stream_Overlap, Rocprof-compute_ROCm_Roofline_Check, TAU_Trace_Check,
    TAU_Profile_Check, TAU_Check_HIP_Profile and TAU_Check_MPI_Profile. Each now matches on a
    string only the success path can produce.
  • The rocprof-compute Python precondition was exercised in both directions. Under Python 3.9.21 the
    test fails in about three seconds, reporting the version it found and the version it needs. Under
    Python 3.12.12 it runs to completion and the roofline assertion finds a real roofline.csv. The
    failing case is deliberately a failure rather than a skip, so an environment that cannot run
    rocprof-compute is not quietly removed from the failure count.
  • A single-node GPU probe showed that the detection and pass-criteria fixes make the Jacobi-based TAU
    tests build and produce real profile.* / tautrace.* artifacts and pprof output containing MPI
    and HIP routines.
  • The full AAC7 two-node suite then exposed a separate launch-directory issue: the tests built under
    node-local /tmp, but rank 1 was launched on the second node where that directory did not exist. This
    PR fixes that launch assumption too, by keeping the ranks on the node that owns the build directory.
    Verified on two nodes with the checkout in node-local /tmp — the failure reproduces without the fix
    and both invocations pass with it — and then in the full two-node suite, where all four Jacobi TAU
    tests pass on real artifacts (319 pass / 27 fail / 15 skip / 1 timeout of 362, suspicious-pass 0).
  • Three TAU RCCL tests still fail for an environment/package reason: MPICH-built TAU cannot instrument
    the OpenMPI-built rccl-tests benchmark. This PR does not attempt to solve that packaging mismatch.
  • The rocprof-sys PyTorch thread explosion is tracked separately as a rocprof-sys issue, not as a test
    harness bug.

Make profiler and TAU tests assert real artifacts instead of matching
diagnostic text, fail TAU builds explicitly, detect MPI by querying the
wrapper that will actually be used, and check the rocprof-compute
dependency pins before a long profiling run rather than after it.
Comment thread HIP/jacobi/Makefile
endif

IS_OMPI=$(shell which ompi_info 2>/dev/null)
# Ask the wrapper we are about to invoke. `which ompi_info` reports that some

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revise these comments, if we remove the line that has ompi_info then it does not make sense to mention it in a comment. please revies all comments in general to make sure they add something useful, if not remove thanks

source ${PROFILER_TOP_DIR}/setup.sh

# Dependency precondition. `analyze` enforces the exact pins in its own
# requirements.txt and this run ends in `analyze`, so verify them before

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure to test that the changes you are proposing here do not break anything on aac6: run this branch there to make sure these python stuff works there too. rocprof-compute + python can be tricky. thanks

Comment thread tests/CMakeLists.txt
set_property(TEST Rocprof-sys_ROCm_Run_Check PROPERTY SKIP_REGULAR_EXPRESSION "module spider")

add_test(NAME Rocprof-sys_ROCm_Stream_Overlap COMMAND ../rocprof-sys_stream_overlap.sh )
set_property(TEST Rocprof-sys_ROCm_Stream_Overlap PROPERTY PASS_REGULAR_EXPRESSION "proto")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you see in the other tests, we want the tests to have a twofold purpose: 1 be used to check that the installation is working, that is why they are part of the test suite. 2 make sure that when a user runs them standalone they can still get the information they need so we don't want the tests to just output a "PASSED" message, we want the test to also print out the configuration and parameters someone would be interested in seeing. please make sure your changes still allow this, thanks

# unions. Fail here, naming the reason, rather than later with a SyntaxError
# from inside the tool that names no cause.
if ! python3 -c 'import sys; sys.exit(0 if sys.version_info >= (3,10) else 1)' 2>/dev/null; then
echo "ERROR: rocprof-compute needs Python >= 3.10, but python3 is $(python3 -V 2>&1)."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double check this claim please

Comment thread tests/tau_exec_check.sh
# directory: going to /tmp instead
# [proxy:1@node2] launch_procs: unable to change wdir to /tmp/.../build_ewLCPv
#
# The test wants two ranks, not two nodes -- Jacobi's "-g 2 1" topology on two

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rephrase these AI generated comments in human lingo and maybe trim a bit if it applies

@gcapodagAMD gcapodagAMD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @dannybaths please take a look at the comments I left in the files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants