@@ -966,30 +966,45 @@ pipeline {
966966 git branch : " pf-tuna-rocmlir-3" , poll : false , url : ' https://github.com/ROCm/MITuna.git'
967967 }
968968 dir(' build' ) {
969+ def tuningLog = " tune_rocmlir_${ CHIP} .log"
970+ sh """ echo "=== Tuning rocMLIR for ${ CHIP} ===" | tee ${ tuningLog} """
969971 // Tune gemms with default datatypes, fail if the DB is not created
970972 // (Includes int8xint8->int8 for performance comparisons against CK.)
971973 sh """ ../mlir/utils/tuna/tuna-script.sh -o gemm \
972974 -c ../mlir/utils/performance/configs/tier1-gemm-configs \
973- -t ${ WORKSPACE} /MITuna -f mlir_tuning_${ CHIP} .tsv
974- [ -f mlir_tuning_${ CHIP} .tsv ]"""
975+ -t ${ WORKSPACE} /MITuna -f mlir_tuning_${ CHIP} .tsv 2>&1 | tee -a ${ tuningLog }
976+ [ -f mlir_tuning_${ CHIP} .tsv ]"""
975977 // Tune resnet50 and unet configs
976978 sh """ ../mlir/utils/tuna/tuna-script.sh -o convolution \
977979 -c ../mlir/utils/performance/configs/tier1-conv-configs \
978- -t ${ WORKSPACE} /MITuna -f mlir_tuning_${ CHIP} .tsv"""
980+ -t ${ WORKSPACE} /MITuna -f mlir_tuning_${ CHIP} .tsv 2>&1 | tee -a ${ tuningLog } """
979981 // Tune attention configs
980982 sh """ ../mlir/utils/tuna/tuna-script.sh -o attention \
981983 -c ../mlir/utils/performance/configs/tier1-attention-configs \
982- -t ${ WORKSPACE} /MITuna -f mlir_tuning_${ CHIP} .tsv"""
984+ -t ${ WORKSPACE} /MITuna -f mlir_tuning_${ CHIP} .tsv 2>&1 | tee -a ${ tuningLog } """
983985 // Tune gemms with default datatypes, fail if the DB is not created (quick tuning)
984986 // (Includes int8xint8->int8 for performance comparisons against CK.)
985987 sh """ ../mlir/utils/tuna/tuna-script.sh -o gemm \
986988 -c ../mlir/utils/performance/configs/tier1-gemm-configs -s quick \
987- -t ${ WORKSPACE} /MITuna -f mlir_quick_tuning_${ CHIP} .tsv
989+ -t ${ WORKSPACE} /MITuna -f mlir_quick_tuning_${ CHIP} .tsv 2>&1 | tee -a ${ tuningLog }
988990 [ -f mlir_quick_tuning_${ CHIP} .tsv ]"""
989991 // Tune resnet50 and unet configs (quick tuning)
990992 sh """ ../mlir/utils/tuna/tuna-script.sh -o convolution \
991993 -c ../mlir/utils/performance/configs/tier1-conv-configs -s quick \
992- -t ${ WORKSPACE} /MITuna -f mlir_quick_tuning_${ CHIP} .tsv"""
994+ -t ${ WORKSPACE} /MITuna -f mlir_quick_tuning_${ CHIP} .tsv 2>&1 | tee -a ${ tuningLog} """
995+ sh """ echo "=== Tuning rocMLIR for ${ CHIP} completed ===" | tee -a ${ tuningLog} """
996+ // Check for errors in the tuning log
997+ script {
998+ def tuneLog = readFile(tuningLog). split(' \n ' )
999+ def errors = tuneLog. findAll { it =~ / (?i)\b error\b / }
1000+
1001+ if (errors) {
1002+ error(" Tuning failed: Detected errors in tuning log" )
1003+ currentBuild. result = ' FAILURE'
1004+ } else {
1005+ echo " No errors found in tuning log"
1006+ }
1007+ }
9931008 }
9941009 }
9951010 }
0 commit comments