diff --git a/mlir/utils/jenkins/Jenkinsfile b/mlir/utils/jenkins/Jenkinsfile index f8cdfe39ae55..6c5a9fa08d91 100644 --- a/mlir/utils/jenkins/Jenkinsfile +++ b/mlir/utils/jenkins/Jenkinsfile @@ -12,6 +12,42 @@ ConcurrentHashMap DOCKER_ARGS_BY_NODE = new ConcurrentHashMap<>() @Field String DOCKER_HUB_CREDS = "DOCKER_HUB_CREDS" +void filterConfigByDataTypes(String srcConfig, String dstConfig, List allowedTypes) { + def typesSet = allowedTypes.collect { "\"$it\"" }.join(", ") + sh """ + python3 - <<'PY' +from pathlib import Path +import re + +allowed = {${typesSet}} +src = Path("${srcConfig}") +dst = Path("${dstConfig}") + +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 + """ +} + void buildProject(String target, String cmakeOpts) { timeout(time: 60, activity: true, unit: 'MINUTES') { cmakeBuild generator: 'Ninja',\ @@ -1105,9 +1141,7 @@ pipeline { def attnConfigToUse = attnConfig if (CHIP.startsWith("gfx1")) { attnConfigToUse = "tier1-attention-configs-nofp32" - sh """ - grep -v '\\-t f32' ${attnConfig} > ${attnConfigToUse} - """ + filterConfigByDataTypes(attnConfig, attnConfigToUse, ["i8", "f16", "bf16"]) } sh """../mlir/utils/tuna/tuna-script.sh -o attention \ -c ${attnConfigToUse} \