Skip to content

Commit dd3a5b7

Browse files
committed
feat: format support matrix statuses natively in buildkite shell scripts
- record_step_result.sh now directly applies UI-facing statuses like '✅ Passing' - generate_support_matrices.sh now surfaces these formatted statuses - microbenchmark pivoting logic cleaned up to use simple shortened headers Signed-off-by: Rob Mulla <rob.mulla@gmail.com>
1 parent 6ec7923 commit dd3a5b7

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

.buildkite/scripts/generate_support_matrices.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ process_models() {
111111
result="Text"
112112
fi
113113
else
114-
result=$(buildkite-agent meta-data get "${TPU_METADATA_PREFIX}${model}:${stage}" --default "N/A")
114+
result=$(buildkite-agent meta-data get "${TPU_METADATA_PREFIX}${model}:${stage}" --default "N/A")
115115
fi
116116
row="$row,$result"
117-
if [ "$stage" != "Type" ] && [ "${result}" != "" ] && [ "${result}" != "N/A" ] && [ "${result}" != "unverified" ]; then
117+
if [ "$stage" != "Type" ] && [ "${result}" != " Passing" ] && [ "${result}" != "N/A" ] && [ "${result}" != "❓ Untested" ]; then
118118
ANY_FAILED=true
119119
fi
120120
done
@@ -168,16 +168,16 @@ process_features() {
168168
elif [ "$is_quantization_matrix" = true ] && [ "$stage" == "QuantizationMethods" ]; then
169169
# If it's the quantization matrix, hardcode the quantization methods
170170
result="${QUANTIZATION_METHODS["$feature"]:-N/A}"
171+
171172
elif [[ "$mode" == "DEFAULT" ]]; then
172-
result=""
173+
result=" Passing"
173174
else
174-
result=$(buildkite-agent meta-data get "${TPU_METADATA_PREFIX}${feature}:${stage}" --default "N/A")
175+
result=$(buildkite-agent meta-data get "${TPU_METADATA_PREFIX}${feature}:${stage}" --default "N/A")
175176
fi
176-
177177
row="$row,$result"
178178

179179
# Check for failure (exclude the hardcoded TPU generation column and Quantization Methods column)
180-
if [ "$stage" != "QuantizationMethods" ] && [ "$stage" != "RecommendedTPUGenerations" ] && [ "${result}" != "" ] && [ "${result}" != "N/A" ] && [ "${result}" != "unverified" ]; then
180+
if [ "$stage" != "QuantizationMethods" ] && [ "$stage" != "RecommendedTPUGenerations" ] && [ "${result}" != " Passing" ] && [ "${result}" != "N/A" ] && [ "${result}" != "❓ Untested" ]; then
181181
ANY_FAILED=true
182182
fi
183183

@@ -187,6 +187,7 @@ process_features() {
187187
done
188188
}
189189

190+
# Pivot Logic (Microbenchmarks)
190191
process_kernel_matrix_to_pivot() {
191192
local input_csv="${TPU_DIR}/kernel_support_matrix_microbenchmarks.csv"
192193
local output_file="${TPU_DIR}/kernel_support_matrix-microbenchmarks.csv"
@@ -197,12 +198,13 @@ process_kernel_matrix_to_pivot() {
197198
fi
198199

199200
# Define Headers for Display
200-
local header="Kernel,W16 A16 (Correctness),W16 A16 (Performance),W8 A8 (Correctness),W8 A8 (Performance),W8 A16 (Correctness),W8 A16 (Performance),W4 A4 (Correctness),W4 A4 (Performance),W4 A8 (Correctness),W4 A8 (Performance),W4 A16 (Correctness),W4 A16 (Performance)"
201+
local header="Kernel,W16 A16 (Corr),W16 A16 (Perf),W8 A8 (Corr),W8 A8 (Perf),W8 A16 (Corr),W8 A16 (Perf),W4 A4 (Corr),W4 A4 (Perf),W4 A8 (Corr),W4 A8 (Perf),W4 A16 (Corr),W4 A16 (Perf)"
201202
echo "$header" > "$output_file"
202203

203204
# Define the quantization order to match the header
204205
local quant_cols_list="w16a16 w8a8 w8a16 w4a4 w4a8 w4a16"
205206

207+
206208
# Awk Script for Pivoting (Data Rows)
207209
awk -v AWK_QUANT_COLS="$quant_cols_list" '
208210
BEGIN {
@@ -245,17 +247,17 @@ process_kernel_matrix_to_pivot() {
245247
row = out_name;
246248
for (j=1; j<=6; j++) {
247249
q = q_order[j];
248-
# Use original N/A,N/A if data is missing
249-
data = (matrix[k][q] == "") ? "N/A,N/A" : matrix[k][q];
250+
# Use formatted N/A if data is missing
251+
data = (matrix[k][q] == "") ? "N/A,N/A" : matrix[k][q];
250252
row = row OFS data;
251253
}
252254
print row >> "'"$output_file"'";
253255
}
254256
}
255257
' "$input_csv"
256258

257-
# Display the pivoted result
258-
echo "--- $output_file ---"
259+
# Upload the newly created pivot table
260+
echo "--- Uploading Pivoted Kernel Matrix: $output_file ---"
259261
cat "$output_file"
260262
buildkite-agent artifact upload "$output_file"
261263
}

.buildkite/scripts/record_step_result.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ message=""
4444

4545
case $OUTCOME in
4646
"passed")
47-
message=""
47+
message=" Passing"
4848
;;
4949
"skipped")
50-
message="N/A"
50+
message="N/A"
5151
;;
5252
"unverified")
53-
message="unverified"
53+
message="❓ Untested"
5454
;;
5555
*)
56-
message=""
56+
message=" Failing"
5757
;;
5858
esac
5959

0 commit comments

Comments
 (0)