A command-line tool to generate pytest repro commands from cuDNN Frontend SDPA logs.
When a cuDNN SDPA test runs with logging enabled, it captures the exact graph configuration as JSON. This tool:
- Extracts that JSON from log files
- Translates it into a
test_repro()function call - Outputs a pytest command you can run to reproduce the exact same test
This is useful for debugging failures, reproducing CI issues locally, or creating minimal test cases.
# Install globally (recommended)
uv tool install --editable tools/cudnn_repro
# Or install in venv
pip install -e tools/cudnn_repro# 1. Run a test with logging
export CUDNN_FRONTEND_LOG_INFO=1
export CUDNN_FRONTEND_LOG_FILE=/tmp/sdpa.log
pytest test/python/test_mhas_v2.py::test_sdpa_random_fwd_L0[test1]
# 2. Generate repro command
cudnn-repro /tmp/sdpa.log
# 3. Run the repro
# (copy-paste the output command)# Process a log file
cudnn-repro /path/to/log
# Read from stdin
cat log | cudnn-repro -
# Process all entries (not just last)
cudnn-repro --all log
# Debug mode - saves parsed payload and command output
CUDNN_DEBUG_REPRO=1 cudnn-repro logPipeline:
- Parse log context JSON
- Select operation handler
- Extract repro config
- Render pytest command
The tool auto-detects SDPA operation tags and routes to the appropriate handler:
SDPA_FWDSDPA_BWDSDPA_FP8_FWDSDPA_FP8_BWDSDPA_MXFP8_FWDSDPA_MXFP8_BWD
Debug mode (CUDNN_DEBUG_REPRO=1) writes:
cudnn_repro_log.txt- Raw logcudnn_repro_payload.json- Annotated payloadcudnn_repro_command.txt- Final command
pytest tools/cudnn_repro/tests/ -vv
# Control test targets
CUDNN_REPRO_TARGETS="test1,test2" pytest tools/cudnn_repro/tests/