From a94e8007f8b03d1d3eb0153ddee5721ed06ca594 Mon Sep 17 00:00:00 2001 From: Mikhail Chusavitin Date: Mon, 20 Apr 2026 09:26:29 +0300 Subject: [PATCH] Ignore power throttling in benchmark calibration --- audit/internal/platform/benchmark.go | 2 -- audit/internal/platform/benchmark_test.go | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/audit/internal/platform/benchmark.go b/audit/internal/platform/benchmark.go index 1b4e4d2..6984726 100644 --- a/audit/internal/platform/benchmark.go +++ b/audit/internal/platform/benchmark.go @@ -220,8 +220,6 @@ func benchmarkCalibrationThrottleReason(before, after BenchmarkThrottleCounters) return "hw_thermal" case diff.SWThermalSlowdownUS > 0: return "sw_thermal" - case diff.HWPowerBrakeSlowdownUS > 0: - return "hw_power_brake" default: return "" } diff --git a/audit/internal/platform/benchmark_test.go b/audit/internal/platform/benchmark_test.go index 92b26a4..9b2c5da 100644 --- a/audit/internal/platform/benchmark_test.go +++ b/audit/internal/platform/benchmark_test.go @@ -164,6 +164,24 @@ func TestBenchmarkPlannedPhaseStatus(t *testing.T) { } } +func TestBenchmarkCalibrationThrottleReasonIgnoresPowerReasons(t *testing.T) { + t.Parallel() + + before := BenchmarkThrottleCounters{} + if got := benchmarkCalibrationThrottleReason(before, BenchmarkThrottleCounters{SWPowerCapUS: 1_000_000}); got != "" { + t.Fatalf("sw_power_cap should be ignored, got %q", got) + } + if got := benchmarkCalibrationThrottleReason(before, BenchmarkThrottleCounters{HWPowerBrakeSlowdownUS: 1_000_000}); got != "" { + t.Fatalf("hw_power_brake should be ignored, got %q", got) + } + if got := benchmarkCalibrationThrottleReason(before, BenchmarkThrottleCounters{HWThermalSlowdownUS: 1_000_000}); got != "hw_thermal" { + t.Fatalf("hw_thermal mismatch: got %q", got) + } + if got := benchmarkCalibrationThrottleReason(before, BenchmarkThrottleCounters{SWThermalSlowdownUS: 1_000_000}); got != "sw_thermal" { + t.Fatalf("sw_thermal mismatch: got %q", got) + } +} + func TestNormalizeNvidiaBenchmarkOptionsPreservesRunNCCLChoice(t *testing.T) { t.Parallel()