Enhancement - Fix hipblaslt-gemm result parsing for hipBLASLt v1500+ output format#791
Enhancement - Fix hipblaslt-gemm result parsing for hipBLASLt v1500+ output format#791
Conversation
There was a problem hiding this comment.
Pull request overview
Updates hipblaslt-gemm result parsing to support hipBLASLt v1500+ CSV output by using header-based column lookup instead of hardcoded field counts/positions.
Changes:
- Parse the CSV header to dynamically locate the
hipblaslt-Gflopscolumn and validate row width against the header. - Add a unit test covering the new v1500+ (34-column) output format.
- Clarify parsing intent via inline comments.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/benchmarks/micro_benchmarks/test_hipblaslt_function.py | Adds a new test case for v1500+ output and annotates the existing old-format test. |
| superbench/benchmarks/micro_benchmarks/hipblaslt_function.py | Switches parsing to header-based hipblaslt-Gflops extraction and header/data column-count validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #791 +/- ##
==========================================
- Coverage 85.70% 84.37% -1.34%
==========================================
Files 102 103 +1
Lines 7703 8307 +604
==========================================
+ Hits 6602 7009 +407
- Misses 1101 1298 +197
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…sserts - Use exact match (col_name.strip() == 'hipblaslt-Gflops') for the FLOPS column lookup, avoiding accidental matches against future names like 'hipblaslt-Gflops-peak'. - Rewrite the inline comment to drop misleading positional index claims and use the correct 'hipblaslt-GB/s' name instead of 'GB_s'. - Replace brittle assertEqual(2, len(...)) and exact float assertEqual with assertIn(...) + assertAlmostEqual(..., places=3) for the new-format test.
- Harden first-header-field rank-marker stripping with an anchored regex (re.sub r'^\s*\[\d+\]:?'), so a column whose name happens to contain ']' is not truncated. - Add an explicit IndexError guard before reading lines[index + 1] so hipblaslt-bench output that ends on the header (e.g., crash after printing it) yields a clear ValueError instead of a generic IndexError.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # batch_count (index 3) and m,n,k (indices 4-6) are stable across all known formats | ||
| self._result.add_result( | ||
| f'{self._precision_in_commands[cmd_idx]}_{fields[3]}_{"_".join(fields[4:7])}_flops', |
Description
The hipblaslt-gemm benchmark result parser fails with MICROBENCHMARK_RESULT_PARSING_FAILURE (return code 33) when running against hipBLASLt v1500+. The benchmark kernels execute successfully and produce valid TFLOPS data, but SuperBench cannot parse the results into structured metrics.
Root cause: The parser hardcodes len(fields) != 23 to validate the output CSV, but hipBLASLt v1500 outputs 34 columns — it added a_type, b_type, c_type, d_type, scaleA, scaleB, scaleC, scaleD, amaxD, bias_type, aux_type, and hipblaslt-GB/s. This causes two bugs:
Fix
Replace the hardcoded field-count check and positional index with header-based column lookup:
This approach is: