Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enforce native benchmark global output validation at runtime
  • Loading branch information
csadorf committed Oct 30, 2026
commit eb04388b2b1d79ba676dbf036fda0877b00417f5
7 changes: 4 additions & 3 deletions python/cuml/cuml/benchmark/backends/cuml.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def instrumentation(
) -> Iterator[VerificationResult]:
"""Require default output behavior."""
cuml = importlib.import_module("cuml")
assert cuml.global_settings.output_type is None, (
"Native benchmarks require the default global output_type=None"
)
if cuml.global_settings.output_type is not None:
raise ValueError(
"Native benchmarks require the default global output_type=None"
)
yield VerificationResult()
2 changes: 1 addition & 1 deletion python/cuml/tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,7 @@ def test_native_instrumentation_rejects_nondefault_output_type():

backend = get_backend("cuml")
with cuml.using_output_type("numpy"):
with pytest.raises(AssertionError, match="default global output_type"):
with pytest.raises(ValueError, match="default global output_type"):
with backend.instrumentation(None, "measurement", 0):
pytest.fail("nondefault output type must be rejected")
assert cuml.global_settings.output_type == "numpy"
Expand Down