From 747d8f27ea156e4503b3e68ded42a88688ab5fb5 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 30 Nov 2026 12:03:06 -0500 Subject: [PATCH] test: remove tests for hardware no supported driver runs on; deprecate is_auto_boosted_clocks_enabled test_unit_get_devices_returns_array (cuda_bindings_13) needs NVML units, which exist only on Tesla S-class chassis, and test_auto_boosted_clocks_enabled (cuda_core) needs a GPU that reports auto boosted clocks, which only Kepler does. No driver that cuda-bindings 12.x or 13.x supports runs on either, so both tests skipped in every configuration. Delete them, along with the unit_handles fixture. The generated NVML bindings are unchanged. Deprecate cuda.core.system.Device.is_auto_boosted_clocks_enabled, which raises NotSupportedError on every current GPU, following the NvlinkInfo.max_links precedent. Closes #3577. Co-Authored-By: Claude Opus 5.5 --- cuda_bindings_13/tests/nvml/test_unit.py | 33 ------------------- cuda_core/cuda/core/system/_device.pyi | 4 +++ cuda_core/cuda/core/system/_device.pyx | 13 +++++++- cuda_core/docs/source/release/1.4.0-notes.rst | 10 ++++++ cuda_core/tests/system/test_system_device.py | 12 ------- 5 files changed, 26 insertions(+), 46 deletions(-) delete mode 100644 cuda_bindings_13/tests/nvml/test_unit.py diff --git a/cuda_bindings_13/tests/nvml/test_unit.py b/cuda_bindings_13/tests/nvml/test_unit.py deleted file mode 100644 index 65dc40d7998b..000000000000 --- a/cuda_bindings_13/tests/nvml/test_unit.py +++ /dev/null @@ -1,33 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -import pytest - -from cuda.bindings import nvml - - -@pytest.fixture -def unit_handles(nvml_init): - """Yield all unit handles, or skip if no units are present.""" - count = nvml.unit_get_count() - if count == 0: - pytest.skip("No NVML units present on this system") - return [nvml.unit_get_handle_by_index(i) for i in range(count)] - - -# This test is not currently run in any CI job -@pytest.mark.agent_authored(model="claude-sonnet-4-6") -def test_unit_get_devices_returns_array(unit_handles): - """Regression test: unit_get_devices must not crash due to double-pointer cast. - - Previously nvmlUnitGetDevices was called with unit instead of - unit, causing undefined behaviour because nvmlUnit_t is itself an - opaque pointer handle. - """ - for unit in unit_handles: - devices = nvml.unit_get_devices(unit) - # Result is a memoryview / cython array of intptr_t device handles. - assert hasattr(devices, "__len__") - # Each element must be a non-zero pointer (valid device handle). - for dev in devices: - assert dev != 0 diff --git a/cuda_core/cuda/core/system/_device.pyi b/cuda_core/cuda/core/system/_device.pyi index c48d6b4d9d26..deee6ef1f70c 100644 --- a/cuda_core/cuda/core/system/_device.pyi +++ b/cuda_core/cuda/core/system/_device.pyi @@ -1391,6 +1391,10 @@ class Device: bool The default Auto Boosted clocks behavior + .. version-deprecated:: 1.4.0 + This property is deprecated and will be removed in a future release. + Use :meth:`set_application_clocks` and + :meth:`reset_application_clocks` to control Auto Boost behavior. """ @property def current_clock_event_reasons(self) -> list[ClocksEventReasons]: diff --git a/cuda_core/cuda/core/system/_device.pyx b/cuda_core/cuda/core/system/_device.pyx index f06614420ce2..9560a5074e54 100644 --- a/cuda_core/cuda/core/system/_device.pyx +++ b/cuda_core/cuda/core/system/_device.pyx @@ -616,7 +616,18 @@ cdef class Device: bool The default Auto Boosted clocks behavior - """ + .. version-deprecated:: 1.4.0 + This property is deprecated and will be removed in a future release. + Use :meth:`set_application_clocks` and + :meth:`reset_application_clocks` to control Auto Boost behavior. + """ + warnings.warn( + "The `is_auto_boosted_clocks_enabled` property is deprecated and will be removed in a future " + "release. Use `set_application_clocks` and `reset_application_clocks` to control Auto Boost " + "behavior.", + DeprecationWarning, + stacklevel=2, + ) current, default = nvml.device_get_auto_boosted_clocks_enabled(self._handle) return current == nvml.EnableState.FEATURE_ENABLED, default == nvml.EnableState.FEATURE_ENABLED diff --git a/cuda_core/docs/source/release/1.4.0-notes.rst b/cuda_core/docs/source/release/1.4.0-notes.rst index 1be489a39591..5391b9791778 100644 --- a/cuda_core/docs/source/release/1.4.0-notes.rst +++ b/cuda_core/docs/source/release/1.4.0-notes.rst @@ -59,3 +59,13 @@ Fixes and enhancements later driver; with a CUDA 12 build or an older driver, imports behave as before. (`#3502 `__) + +Deprecated APIs +--------------- + +- Deprecated :attr:`system.Device.is_auto_boosted_clocks_enabled`. Only + Kepler GPUs report auto boosted clocks, and no supported driver runs on + them, so the property raises :class:`system.NotSupportedError` on every + current GPU. Use :meth:`system.Device.set_application_clocks` and + :meth:`system.Device.reset_application_clocks` to control Auto Boost + behavior. diff --git a/cuda_core/tests/system/test_system_device.py b/cuda_core/tests/system/test_system_device.py index 3086c0d3303e..d5eb5208bcef 100644 --- a/cuda_core/tests/system/test_system_device.py +++ b/cuda_core/tests/system/test_system_device.py @@ -636,18 +636,6 @@ def test_get_inforom_version(subtests): inforom.validate() -# This test is not currently run in any CI job -def test_auto_boosted_clocks_enabled(subtests): - for device in system.Device.get_all_devices(): - with subtests.test(device_index=device.index): - # This API is supported on KEPLER and newer, but it also seems - # unsupported elsewhere. - with unsupported_before(device, None): - current, default = device.is_auto_boosted_clocks_enabled - assert isinstance(current, bool) - assert isinstance(default, bool) - - def test_clock(subtests): for device in system.Device.get_all_devices(): for clock_type in typing.ClockType: