-
Notifications
You must be signed in to change notification settings - Fork 86
Bug Fix - Fix NVBandwidth benchmark results parsing bug (#748) #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,10 +190,17 @@ def _process_raw_line(self, line, parse_status): | |
|
|
||
| # Parse summary results | ||
| if self.re_summary_pattern.match(line): | ||
| value = self.re_summary_pattern.match(line).group(2) | ||
| test_name = parse_status['test_name'] | ||
| match = self.re_summary_pattern.match(line) | ||
| value = match.group(2) | ||
|
Comment on lines
192
to
+194
|
||
| # Use test_name from parse_status, fallback to group(1) from SUM line | ||
| test_name = parse_status['test_name'] or match.group(1).lower() | ||
| benchmark_type = parse_status['benchmark_type'] | ||
| parse_status['results'][f'{test_name}_sum_{benchmark_type}'] = float(value) | ||
| # Infer benchmark_type from test_name if not set (e.g., after waived tests) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fallback fixes the SUM symptom but masks the true root cause of Upstream
(see
With this PR, the SUM is rescued via the A more complete fix is to broaden the header detector itself, e.g.: re_matrix_header_line = re.compile(r'^(memcpy|memory latency|Device to Device Latency)', re.IGNORECASE)The existing branch |
||
| if benchmark_type is None: | ||
| benchmark_type = 'lat' if 'latency' in test_name else 'bw' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When this guard drops a SUM line (either Please emit a warning here so the drop is observable, e.g.: if test_name and benchmark_type:
parse_status['results'][f'{test_name}_sum_{benchmark_type}'] = float(value)
else:
logger.warning(
f'nvbandwidth: skipping SUM line, incomplete parse state '
f'(test_name={test_name!r}, benchmark_type={benchmark_type!r}, line={line!r})'
)The warning also gives users a clear signal in the runner logs when a future nvbandwidth release adds a test whose header line doesn't match the existing detection patterns. |
||
| # Only add result when we have valid metric name (avoid _sum_None or sum_None) | ||
| if test_name and benchmark_type: | ||
| parse_status['results'][f'{test_name}_sum_{benchmark_type}'] = float(value) | ||
|
Comment on lines
+195
to
+203
|
||
|
|
||
| # Reset parsing state for next test | ||
| parse_status['test_name'] = '' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re_summary_pattern.match(line)is still evaluated twice — once in thisif, then again on the line below to assignmatch. Copilot raised this in #discussion_r2878517701 and @guoshzhao explicitly asked for it to be addressed in #discussion_r3070415674; please collapse the two calls: