Skip to content

Drop OpenCL GPU and skip queue checks with only the default device in test_sycl_queue.py - #3189

Open
antonwolfy wants to merge 2 commits into
masterfrom
drop-opencl-gpu-sycl-queue-tests
Open

antonwolfy wants to merge 2 commits into
masterfrom
drop-opencl-gpu-sycl-queue-tests

Conversation

@antonwolfy

Copy link
Copy Markdown
Contributor

Supersedes #2149.

This PR revisits the scope of dpnp/tests/test_sycl_queue.py:

  • OpenCL GPU devices stay excluded, now by policy: Level Zero is the GPU backend users target, and running on OpenCL GPU is a rare case. The CMPLRLLVM-55640 workaround comment is gone, and the backend check is == "opencl" instead of the substring test in "opencl".
  • Queue checks are skipped when only the default device is available. Inputs created with device=dev then use the same cached queue as the default one. assert_sycl_queue_equal compares device, context, is_in_order and profiling, so a function that ignores the input placement still passes. I confirmed this with a mutant that moves dpnp.abs results to the default device: test_1in_1out passes on L0 GPU alone and on OpenCL CPU alone, and fails only with two devices.
  • Tests that still catch bugs on one device keep running and are marked with the new single_device marker, registered in conftest.py. These are the diff-queue raise tests (test_2in_1out_diff_queue_but_equal_context, test_flat_setitem_diff_queue, test_cho_solve_diff_queue), test_random and test_random_state (in-order queues), and the TestToDevice profiling-queue tests.

Local results:

Devices Passed Skipped
One (L0 GPU, or OpenCL CPU) 75 712 (787 tests ran before)
Two (L0 GPU + OpenCL CPU) 1551 34 (same as master)

GHA runners have a single OpenCL CPU device, so 712 tests are skipped there now. Jenkins GPU nodes keep L0 GPU + OpenCL CPU, so the cross-device checks still run there.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

… test_sycl_queue.py

Level Zero is the GPU backend users target, so OpenCL GPU devices stay out of the tested devices, now by policy rather than as the CMPLRLLVM-55640 workaround.

When the default device is the only one, inputs share the default queue and a dropped placement passes unnoticed, so those tests are skipped. Tests marked with the new `single_device` marker still run: they use a second queue on the same device or an in-order or profiling queue.
@github-actions

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/3189/index.html

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.22.0dev2=np2py314h8d9cdd5_8 ran successfully.
Passed: 1491
Failed: 0
Skipped: 6

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 84.245% (-0.02%) from 84.269% — drop-opencl-gpu-sycl-queue-tests into master

test_left_right_args now passes only left or only right, and xp no longer spans all of x, so left and right are actually used. This covers the one-sided branch of the interpolate extension, which test_sycl_queue.py no longer reaches on a single-device host.
Comment on lines +47 to +54
only_default_dev = all(d == dpctl.select_default_device() for d in valid_dev)


@pytest.fixture(autouse=True)
def skip_if_only_default_device(request):
marked = request.node.get_closest_marker("single_device") is not None
if only_default_dev and not marked:
pytest.skip("needs a SYCL device other than the default one")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With only the default device these checks still catch real bugs: get_execution_queue compares queue identity, so a result on a new queue, or an ignored sycl_queue=, fails. CI has only the CPU, so the fixture skips 712 of 787 tests there (on master they run in about 7 s):

import dpctl, dpnp
import dpnp.tensor as dpt

x = dpnp.ones(10)  # default device, default queue
y = dpnp.asarray(x, sycl_queue=dpctl.SyclQueue(x.sycl_device))
print(dpt.get_execution_queue([x.sycl_queue, y.sycl_queue]))  # None on GPU and CPU

Could we keep them running? To catch a dropped placement too, the inputs could be built on dpctl.SyclQueue(device) instead of the default queue.

Comment on lines +50 to +53
@pytest.fixture(autouse=True)
def skip_if_only_default_device(request):
marked = request.node.get_closest_marker("single_device") is not None
if only_default_dev and not marked:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the skip stays: test_copy_method, test_astype, test_indices, test_tri_diag_indices and test_mask_indices also pass a new dpctl.SyclQueue(device), but they are not marked single_device, so CI skips them. If tril_indices ignored sycl_queue=, master's CPU CI would fail and this branch would pass. Could you mark them too? The open dpnp.random PRs (#3157-#3163) add more such tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants