# rocprof capture of library GEMM kernels dispatched by PyTorch.
#
# Unlike hip-gemm, this payload needs a PyTorch-for-ROCm interpreter, so the
# usual way to run it is to install aorta inside a ROCm PyTorch container and
# run the whole sweep there -- see README.md. Wrapping `docker run` from the
# host would profile the docker client, not the GPU work.
#
#   aorta sweep run \
#       --recipe examples/profiling/rocprof/torch-matmul/recipe.yaml \
#       --output ./profiling_results \
#       -- python examples/profiling/rocprof/torch-matmul/matmul.py \
#            --size 2048 --iters 20 --dtype float16
schema_version: 1
mode: probe

ticket: PROFILING-TORCH-MATMUL

trials: 1
# PyTorch import plus hipBLASLt autotuning on a cold cache is slow; the
# default 1800s probe timeout is kept rather than tightened.
timeout_per_trial: 1800

mitigation_axis: [none]
diagnostic_axis: [none]

env_passthrough_mode: inherit

# `hip` is added to the trace so HIP API calls appear alongside dispatches --
# useful for telling launch overhead apart from kernel time in a framework
# stack. `kernel_include_regex` narrows the summary to the GEMM kernels
# (hipBLASLt Tensile kernels are named `Cijk_*`) so memory-fill and
# elementwise noise stays out of the top-kernel metric.
collect:
  rocprof:
    trace: "kernel,hip"
    output_format: "csv"
    stats: "1"
    kernel_include_regex: "Cijk|gemm|matmul"
    summary_units: "msec"
