[benchmarking] Add configurable GPU memory warning threshold#1966
Conversation
Adds `max_allowed_gpu_mem_use_warning_threshold` at session and entry level so pre-run GPU warnings only fire when memory usage exceeds a configured fraction of total GPU memory. Warnings are collected from both pre- and post-run checks and stored in `result_data["warnings"]` so sinks (e.g. SlackSink) can read them directly instead of re-deriving them from raw GPU stats. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: rlratzel <rratzel@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: rlratzel <rratzel@nvidia.com>
- Rename `max_allowed_gpu_mem_use_warning_threshold` to `gpu_mem_use_warning_threshold` (less wordy; "threshold" already implies a limit). - Add a `warning_threshold_msg` parameter to `log_gpu_stats` so callers can tag warnings with a context-specific suffix; `run.py` now uses "used before benchmark started" pre-run and "left in use after benchmark ended" post-run. - Post-run check now also honors the threshold (was previously bare), matching the pre-run behavior so small residuals don't trip warnings. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: rlratzel <rratzel@nvidia.com>
Greptile SummaryThis PR adds a configurable
Confidence Score: 5/5The change is well-scoped: validation is enforced at construction for both session and entry, inheritance is correct, and the SlackSink falls back gracefully when warnings are absent. All mutations are confined to the benchmarking subsystem. The threshold validation covers both Session and Entry, the None-threshold legacy path is preserved correctly, and the SlackSink decoupling uses a safe .get() fallback. No data paths were broken. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant run_entry
participant log_gpu_stats
participant result_data
participant SlackSink
run_entry->>log_gpu_stats: "gpu_stats_before, warn_if_in_use=True,<br/>warning_threshold=entry.gpu_mem_use_warning_threshold,<br/>msg="used before benchmark started""
log_gpu_stats-->>run_entry: warnings[] (pre-run)
run_entry->>run_entry: run_command_with_timeout(cmd)
run_entry->>log_gpu_stats: "get_gpu_stats(), warn_if_in_use=True,<br/>warning_threshold=entry.gpu_mem_use_warning_threshold,<br/>msg="left in use after benchmark ended""
log_gpu_stats-->>run_entry: warnings[] (post-run)
run_entry->>result_data: "update({..., "warnings": pre+post warnings})"
run_entry->>SlackSink: register_benchmark_entry_finished(result_data)
SlackSink->>result_data: get("warnings", [])
SlackSink-->>SlackSink: render warning lines in Slack message
Reviews (3): Last reviewed commit: "[benchmarking] Document warning_threshol..." | Re-trigger Greptile |
Update the YAML comment and the session docstring to make clear that the `gpu_mem_use_warning_threshold` is applied to GPU memory usage checks both before and after each benchmark run, not just before. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: rlratzel <rratzel@nvidia.com>
Adds the missing docstring entry for the `warning_threshold_msg` argument introduced in an earlier commit on this branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: rlratzel <rratzel@nvidia.com>
Summary
gpu_mem_use_warning_thresholdat session and per-entry level so GPU memory warnings only fire when usage exceeds a configured fraction of total GPU memory (0.0-1.0)ValueErrorresult_data["warnings"]so sinks (e.g. SlackSink) read them directly instead of re-deriving them from raw GPU statsTest plan
gpu_mem_use_warning_thresholdset in the session config and confirm warnings only fire when GPU usage exceeds the thresholdValueErrorat session/entry constructionresult_data["warnings"]is populated and appears correctly in the Slack sink message🤖 Generated with Claude Code