From 0771e394e6e4dba21308b881c448c5d8e163e956 Mon Sep 17 00:00:00 2001 From: Jim Crist-Harif Date: Mon, 10 Aug 2026 12:24:59 -0500 Subject: [PATCH] Update onnxruntime tests - Re-enable tests on Python 3.14, onnx now ships packages for this python version - Gate `RandomForestClassifier` xfail to apply only to `onnxruntime < 1.28.0` --- dependencies.yaml | 16 ++-------------- python/cuml/cuml_accel_tests/test_onnx.py | 7 +++++-- python/cuml/pyproject.toml | 2 ++ 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index 026c7ed414..57274e3b50 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -631,17 +631,6 @@ dependencies: - --extra-index-url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple - matrix: # fallback for non-nightly dependencies packages: - # TODO: remove this block once `onnxruntime` has Python 3.14 support (and conda packages built) - - output_types: [conda, requirements, pyproject] - matrices: - - matrix: {py: "3.14"} - packages: - - matrix: {py: "3.*"} - packages: - - *onnxruntime - - *skl2onnx - - matrix: - packages: # TODO: we're seeing test failures with openblas > 0.3.30 on aarch64. For # now we pin openblas in tests on that architecture. - output_types: [conda] @@ -678,9 +667,8 @@ dependencies: - numpydoc<1.9 # 'nvidia-ml-py' provides the 'pynvml' module - nvidia-ml-py>=12 - # TODO: uncomment these two lines once `onnxruntime` has Python 3.14 support (and conda packages built) - # - *onnxruntime - # - *skl2onnx + - *onnxruntime + - *skl2onnx - pytest - pytest-benchmark - pytest-cov diff --git a/python/cuml/cuml_accel_tests/test_onnx.py b/python/cuml/cuml_accel_tests/test_onnx.py index 1b24458be7..368c12a25b 100644 --- a/python/cuml/cuml_accel_tests/test_onnx.py +++ b/python/cuml/cuml_accel_tests/test_onnx.py @@ -1,10 +1,11 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 import hdbscan import numpy as np import pytest import umap +from packaging.version import Version from sklearn.cluster import DBSCAN, KMeans from sklearn.datasets import make_classification, make_regression from sklearn.decomposition import PCA, TruncatedSVD @@ -22,6 +23,8 @@ ort = pytest.importorskip("onnxruntime") skl2onnx = pytest.importorskip("skl2onnx") +ORT_VERSION = Version(ort.__version__) + convert_sklearn = skl2onnx.convert_sklearn FloatTensorType = skl2onnx.common.data_types.FloatTensorType @@ -63,7 +66,7 @@ def regression_data(): classifiers = [ pytest.param( RandomForestClassifier(n_estimators=20, max_depth=8, random_state=42), - marks=xfail_skl2onnx_bug, + marks=(xfail_skl2onnx_bug if ORT_VERSION < Version("1.28.0") else ()), id="RandomForestClassifier", ), pytest.param(KNeighborsClassifier(), id="KNeighborsClassifier"), diff --git a/python/cuml/pyproject.toml b/python/cuml/pyproject.toml index 2b56a79585..beb3eff0a4 100644 --- a/python/cuml/pyproject.toml +++ b/python/cuml/pyproject.toml @@ -123,6 +123,7 @@ test = [ "nltk", "numpydoc<1.9", "nvidia-ml-py>=12", + "onnxruntime", "pynndescent", "pytest", "pytest-benchmark", @@ -132,6 +133,7 @@ test = [ "scikit-learn>=1.6", "seaborn", "shap", + "skl2onnx", "statsmodels", "umap-learn>=0.5.7,<0.5.13", "xgboost>=2.1.0",