dpnp: split quickstart and migration by size, cover multi-queue placement and dtype parity #100
Ran the new claims on dpnp 0.21.0 / dpctl 0.23.0 from PyPI on a CPU SYCL device. The six queue-mismatch errors match the text word for word, device= sharing one cached queue, _like and sycl_queue=x.sycl_queue inheriting it, the reduce-then-move example, to_device returning a view inside one context, the fp64 probe, and SYCL_DEVICE_FILTER having no effect all hold.
One command does not: after pip install dpnp in a venv, ONEAPI_DEVICE_SELECTOR=opencl:cpu python my_script.py leaves no device at all, and the first array raises SyclDeviceCreationError: Default device is unavailable; ONEAPI_DEVICE_SELECTOR=':cpu' keeps opencl:cpu:0. With a backend named, the UR loader opens libOpenCL.so.1 from intel-opencl-rt, which has no RUNPATH, so libsvml.so beside it is not found (UR_LOG_LOADER=level:debug;output:stderr shows it). Not checked on a conda install. Either *:cpu in the example or a line saying so would fix it; dpnp-troubleshooting already has the same line on main, so the same change there would keep them aligned.
🟢 Approved · reviewed d92a448
Next: nothing required from @antonwolfy.
Verified on d92a448: ✅ full suite with main merged in: 101 passed · ✅ merges onto main
<details><summary>3 checks behind it, each with its evidence</summary>
| Area | What holds | How |
|---|---|---|
| Description length | The five changed descriptions are 519 (io), 562 (linalg-fft), 561 (memory), 622 (migration) and 611 (quickstart) characters, under the 1024 limit in CONTRIBUTING.md | full suite, main merged in |
| Repository checks | validate_skills.py, run_evals.py --validate and tools/tests exit 0 with the PR merged onto main | full suite, main merged in |
| Merge | The branch merges onto current main without conflict | merge onto main |
</details>
Confirmed, thanks. With dpnp 0.21.0 / dpctl 0.23.0 from PyPI (runtime wheels 2026.2.0), any selector that names only the opencl backend finds no device. libsycl.so.9 opens the wheel's libOpenCL.so.1, which needs libsvml.so but has no RUNPATH. Only the Level Zero adapter loads libsvml.so first, and such a selector skips it. Conda installs work with every selector.
Both quickstart lines and the dpnp-troubleshooting one now use '*:cpu', with one sentence on both conditions. The selector bug is reported to the compiler runtime team.
Approving at 7951437: the quickstart and troubleshooting selector examples now use ONEAPI_DEVICE_SELECTOR=':cpu'. I reproduced the change on dpnp 0.21.0 from PyPI in a CPU SYCL image: opencl:cpu finds no device, :cpu finds opencl:cpu:0. Earlier review points are resolved.
vchamarthi
antonwolfy
What this changes
Redraws three boundaries that #94 set, and fills gaps the routing test found. This is dpnp descriptions plus the body text they now promise:
ONEAPI_DEVICE_SELECTOR(pin the CPU or one device without changing code) moves into the body, so the skill that now owns device choice also has the no-code-change answer. Until now only troubleshooting had it.ExecutionPlacementErrorfor element-wise,ValueErrorformatmul/dot/linalg.solveand forconcatenate. It also gives the fixes (sycl_queue=,*_like,to_device()) and whatto_device()costs, by SYCL context. No skill covered this before.has_aspect_fp64anddpnp.default_float_type(). That includes integer inputs thatmean, division orsqrtpromote to float32 on devices without fp64. Roundoff in linalg or FFT results is handed to dpnp-linalg-fft.#94's other boundaries are kept: planning a port is migration, while a call that already failed is troubleshooting; choosing a device, including forcing the CPU, is quickstart. The descriptions are 519–622 characters.
How it was measured
90 requests: 10 for each of the 8 dpnp skills, plus 10 near-miss requests whose right answer is xpu-port, cuda-to-xpu-migration or mkl-extension-advisor. They were written without reading the skills. Each dpnp skill has 6 tuning (dev) and 4 held-out (test) requests, and descriptions were tuned on dev only. I reviewed the gold labels as dpnp maintainer. Then I moved three dev labels to the #94 boundaries I accept above; no test label changed.
Each request went through the full 35-skill catalog (names and descriptions only), 3 repeats, with Claude Sonnet 5.5 and Claude Haiku 5.5. That's dokimi's all-vs-all routing.
Share of picks that chose the gold skill:
| | before #94 (e7f1757) | main (7a7dc38) | this PR |
|---|---|---|---|
| Sonnet, test | 0.89 | 0.86 | 0.95 |
| Sonnet, all 90 | 0.87 | 0.88 | 0.94 |
| Haiku, test | 0.87 | 0.84 | 0.89 |
| Haiku, all 90 | 0.89 | 0.86 | 0.89 |
The overall change against main is not significant: per request, Sonnet has 7 better and 1 worse (sign test p = 0.07), Haiku 10 better and 6 worse (p = 0.45). Gold or an acceptable alternative stays at 0.96–1.00 in every version. So this PR's claim is the requests below, not a percentage gain.
Fixed, in all repeats of both models:
| Request | Split | main picks | this PR |
|---|---|---|---|
| Smallest change to make my existing NumPy script run on my Intel Arc GPU | dev | migration | quickstart |
| One NumPy function on the GPU, checked against NumPy | test | migration | quickstart |
| Two GPUs: an array on each, each operation where its data is | dev | quickstart | memory |
| An element-wise operation fails with a placement error on one GPU | test | troubleshooting | memory |
Kept: forcing the CPU without code changes goes to quickstart, and same values and dtypes as NumPy goes to migration.
Held-out checks that the new wording doesn't over-reach (test requests, none of their words in any description; the test requests are not quoted here, so they stay held out):
matmultolerance question stays on linalg-fft;Known misses, not fixed here:
device=). Acceptable on the merits; I didn't change its alternative after seeing the picks.Caveats:
to_device()view (peer access) are not checked on a two-GPU machine. The text hedges the first and states the second from the dpnp source.Checklist
descriptionagainst requests a user would really type — see CONTRIBUTING.md.python3 tools/validate_skills.pypasses locally.