Adding Performance Determinism Mode to rocm_smi lib, CLI & gtest.

A special mode of operation to achieve minimal performance variation by letting
the user have the ability to provide the desired frequency to be set as the soft limit.
The user can control the entry and exit to the mode via rocm-smi a mechanism to
enter / exit performance determinism mode as below.

Enter performance determinism mode:
- hold a lock
- write performance_determinism to power_dpm_force_performance_level
- write input clk_freq to pp_dpm_sclk
- release lock

Exit performance determinism_mode:
- hold a lock
- write auto to power_dpm_force_performance_level
- release lock

Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: Ia24e27954cdf1c4337ffc83d8948fbdfaf4552d2
This commit is contained in:
Divya Shikre
2020-10-30 13:40:26 -04:00
والد c0c1fd2098
کامیت 60d0f3052f
8فایلهای تغییر یافته به همراه346 افزوده شده و 3 حذف شده
+34 -1
مشاهده پرونده
@@ -165,8 +165,9 @@ typedef enum {
//!< memory clock
RSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK, //!< Stable power state with minimum
//!< system clock
RSMI_DEV_PERF_LEVEL_DETERMINISM, //!< Performance determinism state
RSMI_DEV_PERF_LEVEL_LAST = RSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK,
RSMI_DEV_PERF_LEVEL_LAST = RSMI_DEV_PERF_LEVEL_DETERMINISM,
RSMI_DEV_PERF_LEVEL_UNKNOWN = 0x100 //!< Unknown performance level
} rsmi_dev_perf_level_t;
@@ -2062,6 +2063,37 @@ rsmi_dev_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent);
rsmi_status_t rsmi_dev_perf_level_get(uint32_t dv_ind,
rsmi_dev_perf_level_t *perf);
/**
* @brief Enter performance determinism mode with provided device index.
*
* @details Given a device index @p dv_ind and @p freq_bitmask, this function
* will enable performance determinism mode, which enforces a GFXCLK frequency
* SoftMax limit per GPU set by the user. This prevents the GFXCLK FLL from
* stretching when running the same workload on different GPUS, making
* performance variation minimal. This call will result in the performance
* level ::rsmi_dev_perf_level_t of the device being
* ::RSMI_DEV_PERF_LEVEL_DETERMINISM. If a bit in @p freq_bitmask has a value
* of 1, then the frequency (as ordered in an ::rsmi_frequencies_t returned
* by rsmi_dev_gpu_clk_freq_get()) corresponding to that bit index will be
* allowed.
* ::rsmi_dev_perf_level_set() should be called with ::RSMI_DEV_PERF_LEVEL_AUTO
* to restore the performance level to the default value.
*
* @param[in] dv_ind a device index
*
* @param[in] freq_bitmask A bitmask indicating the indices of the
* frequencies that are to be enabled (1) and disabled (0). Only the lowest
* ::rsmi_frequencies_t.num_supported bits of this mask are relevant.
*
* @retval ::RSMI_STATUS_SUCCESS call was successful
* @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not
* support this function with the given arguments
* @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
*
*/
rsmi_status_t rsmi_perf_determinism_mode_set(uint32_t dv_ind,
uint64_t freq_bitmask);
/**
* @brief Get the overdrive percent associated with the device with provided
* device index.
@@ -2085,6 +2117,7 @@ rsmi_status_t rsmi_dev_perf_level_get(uint32_t dv_ind,
* @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
*
*/
rsmi_status_t rsmi_dev_overdrive_level_get(uint32_t dv_ind, uint32_t *od);
/**