Repository navigation
Drop OpenCL GPU and skip queue checks with only the default device in test_sycl_queue.py - #3189
antonwolfy wants to merge 2 commits into
Conversation
… 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.
|
View rendered docs @ https://intelpython.github.io/dpnp/pull/3189/index.html |
|
Array API standard conformance tests for dpnp=0.22.0dev2=np2py314h8d9cdd5_8 ran successfully. |
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.
| 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") |
There was a problem hiding this comment.
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 CPUCould we keep them running? To catch a dropped placement too, the inputs could be built on dpctl.SyclQueue(device) instead of the default queue.
| @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: |
There was a problem hiding this comment.
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.
Supersedes #2149.
This PR revisits the scope of
dpnp/tests/test_sycl_queue.py:== "opencl"instead of the substring testin "opencl".device=devthen use the same cached queue as the default one.assert_sycl_queue_equalcompares device, context,is_in_orderand profiling, so a function that ignores the input placement still passes. I confirmed this with a mutant that movesdpnp.absresults to the default device:test_1in_1outpasses on L0 GPU alone and on OpenCL CPU alone, and fails only with two devices.single_devicemarker, registered inconftest.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_randomandtest_random_state(in-order queues), and theTestToDeviceprofiling-queue tests.Local results:
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.