diff --git a/mlir/utils/jenkins/Jenkinsfile b/mlir/utils/jenkins/Jenkinsfile index 082a1ebaf193..31c17a80ae67 100644 --- a/mlir/utils/jenkins/Jenkinsfile +++ b/mlir/utils/jenkins/Jenkinsfile @@ -1016,11 +1016,23 @@ void setHeartbeat() { } } +List getEnabledMfmaArchitectures() { + def architectures = [] + if (params.disable942 == false) architectures << 'gfx942' + if (params.disable908 == false) architectures << 'gfx908' + if (params.disable90a == false) architectures << 'gfx90a' + return architectures +} + String getLabelFromCodepath(String codepath) { echo "codepath is ${codepath}" String label = '' if (codepath == "mfma") { - label = 'mlir && (gfx942 || gfx908 || gfx90a)' + def architectures = getEnabledMfmaArchitectures() + if (architectures.isEmpty()) { + error 'mfma codepath selected but all of gfx942/gfx908/gfx90a are disabled' + } + label = "mlir && (${architectures.join(' || ')})" } else if (codepath == "gfx950") { if (params.weekly) { label = 'mlir && linux-mi350-8' @@ -1155,7 +1167,8 @@ boolean shouldRunFromCodepath(String codepath) { return true } // Run mfma on private CI - if ((codepath == "mfma") && params.canXdlops) { + if ((codepath == "mfma") && params.canXdlops && + !getEnabledMfmaArchitectures().isEmpty()) { return true } if (codepath == "gfx950" && params.canXdlops && params.disable950 == false) { @@ -1227,7 +1240,7 @@ boolean shouldRunBuildAndTest(String codepath) { // When a particular codepath is selected, we only test the codepath // on private CI if (params.codepath == codepath && params.canXdlops) { - if (params.codepath == "mfma") return true + if (params.codepath == "mfma") return !getEnabledMfmaArchitectures().isEmpty() if (params.codepath == "vanilla") return true if (params.codepath == "gfx950" && params.disable950 == false) return true if (params.codepath == "gfx103x" && params.disableGfx103x == false) return true @@ -2317,6 +2330,9 @@ pipeline { // One big scripted step per matrix row stages { stage('Matrix row orchestration') { + when { + expression { shouldRunFromCodepath(CODEPATH) } + } steps { // Do not fail the build on code coverage catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {