From b926daf09faa02cbe0ba8e77a2d001b82a439ced Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Sun, 13 Apr 2025 03:53:59 +0000 Subject: [PATCH] Better throttle recovery delay --- docs/cli_help.md | 4 ++-- nvbench/benchmark_base.cuh | 4 ++-- nvbench/detail/measure_cold.cuh | 20 ++++++++++---------- nvbench/option_parser.cu | 2 +- nvbench/state.cuh | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/cli_help.md b/docs/cli_help.md index 5b70096..e6d96d3 100644 --- a/docs/cli_help.md +++ b/docs/cli_help.md @@ -140,13 +140,13 @@ * `--throttle-threshold ` * Set the GPU throttle threshold as percentage of the peak clock rate. - * Default is 0.75 (75%). + * Default is 75%. * Applies to the most recent `--benchmark`, or all benchmarks if specified before any `--benchmark` arguments. * `--throttle-recovery-delay ` * Set the GPU throttle recovery delay in seconds. - * Default is 0.5 seconds. + * Default is 0.05 seconds. * Applies to the most recent `--benchmark`, or all benchmarks if specified before any `--benchmark` arguments. diff --git a/nvbench/benchmark_base.cuh b/nvbench/benchmark_base.cuh index 3ed0ebf..4e658b5 100644 --- a/nvbench/benchmark_base.cuh +++ b/nvbench/benchmark_base.cuh @@ -309,8 +309,8 @@ protected: nvbench::float64_t m_skip_time{-1.}; nvbench::float64_t m_timeout{15.}; - nvbench::float32_t m_throttle_threshold{0.75f}; // [% of peak SM clock rate] - nvbench::float32_t m_throttle_recovery_delay{0.0f}; // [seconds] + nvbench::float32_t m_throttle_threshold{0.75f}; // [% of peak SM clock rate] + nvbench::float32_t m_throttle_recovery_delay{0.05f}; // [seconds] bool m_discard_on_throttle{false}; nvbench::criterion_params m_criterion_params; diff --git a/nvbench/detail/measure_cold.cuh b/nvbench/detail/measure_cold.cuh index 1c6d1e7..7e409fd 100644 --- a/nvbench/detail/measure_cold.cuh +++ b/nvbench/detail/measure_cold.cuh @@ -18,24 +18,24 @@ #pragma once +#include + #include #include #include #include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include - -#include - #include #include + #include "nvbench/types.cuh" namespace nvbench @@ -91,7 +91,7 @@ protected: nvbench::blocking_kernel m_blocker; nvbench::criterion_params m_criterion_params; - nvbench::stopping_criterion_base& m_stopping_criterion; + nvbench::stopping_criterion_base &m_stopping_criterion; nvbench::detail::gpu_frequency m_gpu_frequency; bool m_disable_blocking_kernel{false}; @@ -102,8 +102,8 @@ protected: nvbench::float64_t m_skip_time{}; nvbench::float64_t m_timeout{}; - nvbench::float32_t m_throttle_threshold{0.75f}; // [% of peak SM clock rate] - nvbench::float32_t m_throttle_recovery_delay{0.0f}; // [seconds] + nvbench::float32_t m_throttle_threshold; // [% of peak SM clock rate] + nvbench::float32_t m_throttle_recovery_delay; // [seconds] bool m_discard_on_throttle{false}; nvbench::int64_t m_total_samples{}; diff --git a/nvbench/option_parser.cu b/nvbench/option_parser.cu index 04b50fb..98a1f84 100644 --- a/nvbench/option_parser.cu +++ b/nvbench/option_parser.cu @@ -1071,7 +1071,7 @@ try } else if (prop_arg == "--throttle-threshold") { - bench.set_throttle_threshold(static_cast(value)); + bench.set_throttle_threshold(static_cast(value) / 100.0f); } else if (prop_arg == "--throttle-recovery-delay") { diff --git a/nvbench/state.cuh b/nvbench/state.cuh index 8d56c0f..321e068 100644 --- a/nvbench/state.cuh +++ b/nvbench/state.cuh @@ -338,8 +338,8 @@ private: nvbench::float64_t m_skip_time; nvbench::float64_t m_timeout; - nvbench::float32_t m_throttle_threshold{0.75f}; // [% of peak SM clock rate] - nvbench::float32_t m_throttle_recovery_delay{0.0f}; // [seconds] + nvbench::float32_t m_throttle_threshold; // [% of peak SM clock rate] + nvbench::float32_t m_throttle_recovery_delay; // [seconds] bool m_discard_on_throttle{false}; // Deadlock protection. See blocking_kernel's class doc for details.