Skip to content
Prev Previous commit
Next Next commit
Remove estimator-specific benchmark conversion policy tests
  • Loading branch information
csadorf committed Nov 10, 2026
commit 123a6cffc635645a5534496862e70c3498f3cdb6
60 changes: 0 additions & 60 deletions python/cuml/tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -2608,30 +2608,6 @@ def get_params(self, deep=False):
assert result["parameters"]["effective"] == expected


def test_dask_dbscan_uses_local_input(monkeypatch):
case = resolve_case(_request(estimator="DBSCAN"), PROFILE)
X = np.zeros((64, 8), dtype=np.float32)
y = np.zeros(64, dtype=np.int64)
spec = get_provider("cuml.dask").estimator_spec(case.estimator)
backend = get_backend("cuml.dask")
monkeypatch.setattr(harness, "generate_data", lambda case: (X, y))
monkeypatch.setattr(
backend,
"convert_data",
lambda *args, **kwargs: pytest.fail(
"host inputs must bypass conversion"
),
)
monkeypatch.setattr(
backend, "prepare_inputs", lambda inputs, client: inputs
)
monkeypatch.setattr(backend, "load_estimator", lambda spec: object)
prepared = harness._prepare_case(
backend, _suite(case, provider="cuml.dask"), case, spec
)
assert prepared.operation_args[0] is X


@pytest.mark.parametrize("count", [0, 1])
def test_dask_requires_multiple_gpus(monkeypatch, count):
def import_module(name):
Expand Down Expand Up @@ -3196,42 +3172,6 @@ def prepare_inputs(inputs, runtime):
assert prepared.fit_args is None


@pytest.mark.parametrize(
"provider_name", ["scikit-learn", "cuml", "cuml.dask"]
)
@pytest.mark.parametrize("estimator", ["PCA", "LabelEncoder", "DBSCAN"])
@pytest.mark.parametrize("role", ["X", "y"])
def test_provider_conversion_policy(
monkeypatch, provider_name, estimator, role
):
provider = get_provider(provider_name)
value = object()
converted = object()
calls = []

def convert(value, *, representation):
calls.append((value, representation))
return converted

monkeypatch.setattr(provider.backend, "convert_data", convert)
result = provider.convert_data(
value, estimator=estimator, role=role, representation="array"
)
if provider_name == "cuml.dask" and estimator == "DBSCAN":
assert result is value
assert calls == []
else:
representation = (
"series"
if provider_name == "cuml.dask"
and estimator == "LabelEncoder"
and role == "y"
else "array"
)
assert result is converted
assert calls == [(value, representation)]


@pytest.mark.parametrize("shape", [(64, 8), (64,)])
def test_native_conversion_preserves_shape_and_values(shape):
host = np.ones(shape)
Expand Down