diff --git a/mlir/utils/jenkins/Jenkinsfile b/mlir/utils/jenkins/Jenkinsfile index 413bc0be1593..a37363ed051b 100644 --- a/mlir/utils/jenkins/Jenkinsfile +++ b/mlir/utils/jenkins/Jenkinsfile @@ -878,7 +878,7 @@ pipeline { buildProject('ci-performance-scripts', '') // How to check out into specific directory, according to stackoverflow. dir('MITuna') { - git branch: "pf-tuna-rocmlir-3", poll: false, url: 'https://github.com/ROCm/MITuna.git' + git branch: "ggtuning", poll: false, url: 'https://github.com/ROCm/MITuna.git' } dir('build') { timeout(time: 60, activity: true, unit: 'MINUTES') { @@ -1094,62 +1094,14 @@ pipeline { stage("Tune rocMLIR") { buildProject('check-rocmlir-build-only ci-performance-scripts', '') dir('MITuna') { - git branch: "pf-tuna-rocmlir-3", poll: false, url: 'https://github.com/ROCm/MITuna.git' + git branch: "ggtuning", poll: false, url: 'https://github.com/ROCm/MITuna.git' } dir('build') { def tuningLog = "tune_rocmlir_${CHIP}.log" sh """echo "=== Tuning rocMLIR for ${CHIP} ===" | tee ${tuningLog}""" // Tune gemms with default datatypes, fail if the DB is not created // (Includes int8xint8->int8 for performance comparisons against CK.) - sh """../mlir/utils/tuna/tuna-script.sh -o gemm \ - -c ../mlir/utils/performance/configs/tier1-gemm-configs \ - -t ${WORKSPACE}/MITuna -f mlir_tuning_${CHIP}.tsv 2>&1 | tee -a ${tuningLog} - [ -f mlir_tuning_${CHIP}.tsv ]""" - // Tune resnet50 and unet configs - sh """../mlir/utils/tuna/tuna-script.sh -o convolution \ - -c ../mlir/utils/performance/configs/tier1-conv-configs \ - -t ${WORKSPACE}/MITuna -f mlir_tuning_${CHIP}.tsv 2>&1 | tee -a ${tuningLog}""" - // Tune attention configs - def attnConfig = "../mlir/utils/performance/configs/tier1-attention-configs" - def attnConfigToUse = attnConfig - if (CHIP.startsWith("gfx1")) { - attnConfigToUse = "tier1-attention-configs-nofp32" - sh """ - python3 - <<'PY' -from pathlib import Path -import re - -allowed = {"i8", "f16", "bf16"} -src = Path("${attnConfig}") -dst = Path("${attnConfigToUse}") - -out_lines = [] -for raw in src.read_text().splitlines(): - line = raw.strip() - if not line or line.startswith("#"): - out_lines.append(raw) - continue - - dtype = None - match = re.search(r"-t\\s+(\\w+)", line) - if match: - dtype = match.group(1) - - if dtype: - if dtype in allowed: - out_lines.append(line) - continue - - for dt in allowed: - out_lines.append(f"-t {dt} {line}") - -dst.write_text("\\n".join(out_lines) + "\\n") -PY - """ - } - sh """../mlir/utils/tuna/tuna-script.sh -o attention \ - -c ${attnConfigToUse} \ - -t ${WORKSPACE}/MITuna -f mlir_tuning_${CHIP}.tsv 2>&1 | tee -a ${tuningLog}""" + // Tune gemms with default datatypes, fail if the DB is not created (quick tuning) // (Includes int8xint8->int8 for performance comparisons against CK.) sh """../mlir/utils/tuna/tuna-script.sh -o gemm \ diff --git a/mlir/utils/tuna/tuna-script.sh b/mlir/utils/tuna/tuna-script.sh index cd966654a079..2edd0b2825df 100755 --- a/mlir/utils/tuna/tuna-script.sh +++ b/mlir/utils/tuna/tuna-script.sh @@ -38,6 +38,10 @@ function clear_tables tablekind="conv" fi + if [ "$tablekind" = "gemm_gemm" ]; then + tablekind="gemmgemm" + fi + # config table has foreign keys from job and results tables. however, # config table doesn't have a session column so we must delete them all. mysql --user root --database tuna -e "delete from rocmlir_${tablekind}_results;" @@ -110,8 +114,8 @@ while getopts ":hc:t:r:f:o:s:l:" arg; do case $arg in o) # Operation (convolution or gemm [default convolution]) OP=${OPTARG} - [ "$OP" = "convolution" ] || [ "$OP" = "gemm" ] || [ "$OP" = "attention" ] \ - || echo "Operation needs to be 'convolution', 'gemm', or 'attention'." + [ "$OP" = "convolution" ] || [ "$OP" = "gemm" ] || [ "$OP" = "attention" ] || [ "$OP" = "gemm_gemm" ] \ + || echo "Operation needs to be 'convolution', 'gemm', 'attention', or 'gemm_gemm'." ;; c) # Configs file CONFIGS_FILE="${OPTARG}"