Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions mlir/utils/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,42 @@ ConcurrentHashMap<String,String> DOCKER_ARGS_BY_NODE = new ConcurrentHashMap<>()
@Field
String DOCKER_HUB_CREDS = "DOCKER_HUB_CREDS"

void filterConfigByDataTypes(String srcConfig, String dstConfig, List<String> 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',\
Expand Down Expand Up @@ -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} \
Expand Down