From cd8ff3f3de17ed2f74aba01e05b6a249ed54d75f Mon Sep 17 00:00:00 2001 From: "Gainullin, Artur" Date: Mon, 10 Mar 2025 23:37:19 -0700 Subject: [PATCH 1/3] [SYCL][Doc] Add new device descriptors to sycl_ext_intel_device_info extension --- .../supported/sycl_ext_intel_device_info.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md index cb62549cb99c..929a9596c12b 100644 --- a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md +++ b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md @@ -19,6 +19,7 @@ The Feature Test Macro SYCL\_EXT\_INTEL\_DEVICE\_INFO will be defined as one of | 4 | Free device memory query is supported | | 5 | Device ID is supported | | 6 | Memory clock rate and bus width queries are supported | +| 7 | Throttle reasons, fan speed and power limits queries are supported | @@ -489,6 +490,144 @@ Then the memory bus width can be obtained using the standard get\_info() interfa auto MemoryBusWidth = dev.get_info(); } +# Throttle reason # + +A new device descriptor is added which provides the current GPU clock throttle reasons. +A new enum is added with the list of possible throttle reasons. + +## Version ## + +The extension supports this query in version 7 and later. + +## Throttle reasons ## + +| Reason | Description | +| ------------------ | ----------- | +| `power_cap` | The GPU clock frequency is throttled due to hitting the power limit. | +| `current_limit` | The GPU clock frequency is throttled due to hitting the current limit. | +| `thermal_limit` | The GPU clock frequency is throttled due to hitting the thermal limit. | +| `psu_alert` | The GPU clock frequency is throttled due to power supply assertion. | +| `sw_range` | The GPU clock frequency is throttled due to software supplied frequency range. | +| `hw_range` | The GPU clock frequency is throttled because there is a sub block that has a lower frequency when it receives clocks. | +| `other` | The GPU clock frequency is throttled due to other reason. | + + +``` +namespace sycl::ext::intel { + + enum class throttle_reason { + power_cap, + current_limit, + thermal_limit, + psu_alert, + sw_range, + hw_range, + other + } + +} +``` + +## Device Information Descriptors ## + +| Device Descriptors | Return Type | Description | +| ------------------ | ----------- | ----------- | +| `ext::intel::info::device::current_clock_throttle_reasons` | `std::vector` | Returns the set of throttle reasons describing why the frequency is being limited by the hardware. Returns empty set if frequency is not throttled. | + + +## Aspects ## + +A new aspect, `ext_intel_current_clock_throttle_reasons`, is added. + + +## Error Condition ## + +Throws a synchronous `exception` with the `errc::feature_not_supported` error code if the device does not have `aspect::ext_intel_current_clock_throttle_reasons`. + +## Example Usage ## + +Then the current clock throttle reasons can be obtained using the standard `get_info()` interface. + +``` +if (dev.has(aspect::ext_intel_current_clock_throttle_reasons)) { + std::vector Reasons = dev.get_info(); +} +``` + + +# Fan speed # + +A new device descriptor is added which provides the fan speed for the device. + +## Version ## + +The extension supports this query in version 7 and later. + +## Device Information Descriptors ## + +| Device Descriptors | Return Type | Description | +| ------------------ | ----------- | ----------- | +| `ext::intel::info::device::fan_speed` | `int32_t` | Returns the current speed of device's fan (as a percentage of the maximum speed of the fan). If device doesn't have a fan then returns 0. If fan speed can't be measured then returns -1. If there are multiple fans, then returns maximum value. | + + +## Aspects ## + +A new aspect, `ext_intel_fan_speed`, is added. + + +## Error Condition ## + +Throws a synchronous `exception` with the `errc::feature_not_supported` error code if the device does not have `aspect::ext_intel_fan_speed`. + +## Example Usage ## + +Then the fan speed can be obtained using the standard `get_info()` interface. + +``` + if (dev.has(aspect::ext_intel_fan_speed)) { + auto FanSpeed = dev.get_info(); + } +``` + +# Power limits # + +New device descriptors are added which provide the maximum and minimum power limits for the device. + +## Version ## + +The extension supports this query in version 7 and later. + +## Device Information Descriptors ## + +| Device Descriptors | Return Type | Description | +| ------------------ | ----------- | ----------- | +|`ext::intel::info::device::min_power_limit` |`int32_t` | Returns the minimum power limit of the device in milliwatts. | +|`ext::intel::info::device::max_power_limit` |`int32_t` | Returns the maximum power limit of the device in milliwatts. | + + +## Aspects ## + +A new aspect, `ext_intel_power_limits`, is added. + + +## Error Condition ## + +Throws a synchronous `exception` with the `errc::feature_not_supported` error code if the device does not have `aspect::ext_intel_power_limits`. + +## Example Usage ## + +Then the power limits can be obtained using the standard `get_info()` interface. + +``` + if (dev.has(aspect::ext_intel_power_limits)) { + auto Min = dev.get_info(); + auto Max = dev.get_info(); + } +``` + + + + # Deprecated queries # The table below lists deprecated, that would soon be removed and their replacements: From 541925adc38ea0cb3b30e21eecc53ebe1d54bce2 Mon Sep 17 00:00:00 2001 From: "Gainullin, Artur" Date: Tue, 11 Mar 2025 08:20:43 -0700 Subject: [PATCH 2/3] Remove GPU from description --- .../supported/sycl_ext_intel_device_info.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md index 929a9596c12b..7f2632d0a65f 100644 --- a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md +++ b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md @@ -492,7 +492,7 @@ Then the memory bus width can be obtained using the standard get\_info() interfa # Throttle reason # -A new device descriptor is added which provides the current GPU clock throttle reasons. +A new device descriptor is added which provides the current clock throttle reasons. A new enum is added with the list of possible throttle reasons. ## Version ## @@ -503,13 +503,13 @@ The extension supports this query in version 7 and later. | Reason | Description | | ------------------ | ----------- | -| `power_cap` | The GPU clock frequency is throttled due to hitting the power limit. | -| `current_limit` | The GPU clock frequency is throttled due to hitting the current limit. | -| `thermal_limit` | The GPU clock frequency is throttled due to hitting the thermal limit. | -| `psu_alert` | The GPU clock frequency is throttled due to power supply assertion. | -| `sw_range` | The GPU clock frequency is throttled due to software supplied frequency range. | -| `hw_range` | The GPU clock frequency is throttled because there is a sub block that has a lower frequency when it receives clocks. | -| `other` | The GPU clock frequency is throttled due to other reason. | +| `power_cap` | The clock frequency is throttled due to hitting the power limit. | +| `current_limit` | The clock frequency is throttled due to hitting the current limit. | +| `thermal_limit` | The clock frequency is throttled due to hitting the thermal limit. | +| `psu_alert` | The clock frequency is throttled due to power supply assertion. | +| `sw_range` | The clock frequency is throttled due to software supplied frequency range. | +| `hw_range` | The clock frequency is throttled because there is a sub block that has a lower frequency when it receives clocks. | +| `other` | The clock frequency is throttled due to other reason. | ``` From 42bad2e6d02ce0241bd3ec9d6c131c60cf69e9a3 Mon Sep 17 00:00:00 2001 From: Artur Gainullin Date: Tue, 18 Mar 2025 09:17:06 -0700 Subject: [PATCH 3/3] Small corrections * If device doesn't have a fan, then we should report that fan_speed query as unsupported instead of returning 0, because speed can be 0 when fan exists. * L0 returns -1 if limit is unknown, so add clarification to min_power_limit/max_power_limit. --- sycl/doc/extensions/supported/sycl_ext_intel_device_info.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md index 7f2632d0a65f..8349cd4bc09f 100644 --- a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md +++ b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md @@ -567,7 +567,7 @@ The extension supports this query in version 7 and later. | Device Descriptors | Return Type | Description | | ------------------ | ----------- | ----------- | -| `ext::intel::info::device::fan_speed` | `int32_t` | Returns the current speed of device's fan (as a percentage of the maximum speed of the fan). If device doesn't have a fan then returns 0. If fan speed can't be measured then returns -1. If there are multiple fans, then returns maximum value. | +| `ext::intel::info::device::fan_speed` | `int32_t` | Returns the current speed of device's fan (as a percentage of the maximum speed of the fan). If fan speed can't be measured then returns -1. If there are multiple fans, then returns maximum value. | ## Aspects ## @@ -601,8 +601,8 @@ The extension supports this query in version 7 and later. | Device Descriptors | Return Type | Description | | ------------------ | ----------- | ----------- | -|`ext::intel::info::device::min_power_limit` |`int32_t` | Returns the minimum power limit of the device in milliwatts. | -|`ext::intel::info::device::max_power_limit` |`int32_t` | Returns the maximum power limit of the device in milliwatts. | +|`ext::intel::info::device::min_power_limit` |`int32_t` | Returns the minimum power limit of the device in milliwatts. Returns -1 if the limit is not known. | +|`ext::intel::info::device::max_power_limit` |`int32_t` | Returns the maximum power limit of the device in milliwatts. Returns -1 if the limit is not known. | ## Aspects ##