From fad4316eda08ddc825a97e8461da0bf2dbf54a74 Mon Sep 17 00:00:00 2001 From: Djordje Antic Date: Wed, 17 Dec 2025 04:29:09 -0500 Subject: [PATCH 1/5] Initial commit --- mlir/utils/jenkins/Jenkinsfile | 4 ++++ mlir/utils/tuna/tuna-script.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mlir/utils/jenkins/Jenkinsfile b/mlir/utils/jenkins/Jenkinsfile index f4c1baa6c5ef..ed5d37d98663 100644 --- a/mlir/utils/jenkins/Jenkinsfile +++ b/mlir/utils/jenkins/Jenkinsfile @@ -1141,6 +1141,10 @@ 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 gemm_gemm configs + sh """../mlir/utils/tuna/tuna-script.sh -o gemm_gemm \ + -c ../mlir/utils/performance/configs/tier1-gemmgemm-configs \ + -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..4493c83fb9fa 100755 --- a/mlir/utils/tuna/tuna-script.sh +++ b/mlir/utils/tuna/tuna-script.sh @@ -110,8 +110,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}" From 85418eae2d34bb29b01af0d1f53427e403e9e127 Mon Sep 17 00:00:00 2001 From: Djordje Antic Date: Wed, 17 Dec 2025 12:30:14 +0000 Subject: [PATCH 2/5] Use tune-gemmgemm MITuna branch --- mlir/utils/jenkins/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/utils/jenkins/Jenkinsfile b/mlir/utils/jenkins/Jenkinsfile index ed5d37d98663..472ed695bbc2 100644 --- a/mlir/utils/jenkins/Jenkinsfile +++ b/mlir/utils/jenkins/Jenkinsfile @@ -869,7 +869,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: "tune-gemmgemm", poll: false, url: 'https://github.com/ROCm/MITuna.git' } dir('build') { timeout(time: 60, activity: true, unit: 'MINUTES') { @@ -1085,7 +1085,7 @@ 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: "tune-gemmgemm", poll: false, url: 'https://github.com/ROCm/MITuna.git' } dir('build') { def tuningLog = "tune_rocmlir_${CHIP}.log" From db6e9ad58a84e657547ba2c169d1463ebcb7ca36 Mon Sep 17 00:00:00 2001 From: Djordje Antic Date: Wed, 17 Dec 2025 14:47:19 +0100 Subject: [PATCH 3/5] Update Jenkinsfile --- mlir/utils/jenkins/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/utils/jenkins/Jenkinsfile b/mlir/utils/jenkins/Jenkinsfile index 472ed695bbc2..5f8484708753 100644 --- a/mlir/utils/jenkins/Jenkinsfile +++ b/mlir/utils/jenkins/Jenkinsfile @@ -869,7 +869,7 @@ pipeline { buildProject('ci-performance-scripts', '') // How to check out into specific directory, according to stackoverflow. dir('MITuna') { - git branch: "tune-gemmgemm", 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') { @@ -1085,7 +1085,7 @@ pipeline { stage("Tune rocMLIR") { buildProject('check-rocmlir-build-only ci-performance-scripts', '') dir('MITuna') { - git branch: "tune-gemmgemm", 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" From 722b5d72e9c83d36e6b99475245c147f18be088b Mon Sep 17 00:00:00 2001 From: Djordje Antic Date: Mon, 22 Dec 2025 10:16:42 +0000 Subject: [PATCH 4/5] Add support for gemm_gemm tablekind in clear_tables function in tuna-script.sh --- mlir/utils/tuna/tuna-script.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mlir/utils/tuna/tuna-script.sh b/mlir/utils/tuna/tuna-script.sh index 4493c83fb9fa..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;" From a9151b2df09454fe712bedda271c5a14d702b614 Mon Sep 17 00:00:00 2001 From: Djordje Antic Date: Wed, 28 Jan 2026 14:31:49 +0100 Subject: [PATCH 5/5] Update Jenkinsfile --- mlir/utils/jenkins/Jenkinsfile | 54 +--------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/mlir/utils/jenkins/Jenkinsfile b/mlir/utils/jenkins/Jenkinsfile index 534bdd795ae1..362f942eb715 100644 --- a/mlir/utils/jenkins/Jenkinsfile +++ b/mlir/utils/jenkins/Jenkinsfile @@ -1101,59 +1101,7 @@ pipeline { 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 gemm_gemm configs - sh """../mlir/utils/tuna/tuna-script.sh -o gemm_gemm \ - -c ../mlir/utils/performance/configs/tier1-gemmgemm-configs \ - -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 \