Skip to content

Fix more kernel launches over INT_MAX work-items with DPC++ 2026.2 - #3104

Open
antonwolfy wants to merge 2 commits into
masterfrom
fix-id-queries-link-flag
Open

antonwolfy wants to merge 2 commits into
masterfrom
fix-id-queries-link-flag

Conversation

@antonwolfy

Copy link
Copy Markdown
Contributor

This PR passes -fno-sycl-id-queries-fit-in-int at both compile and link time to the ufunc, window and statistics extensions and to the dpnp_backend_c library. Until now only the dpnp.tensor modules and the indexing extension had it.

With DPC++ 2026.2 the range a kernel assumes for its work-item IDs is recorded at the device link step, so these modules recorded the default int range, and their kernels failed when launched over more than INT_MAX work-items:

RuntimeError: The kernel was compiled with -fsycl-id-queries-range=int, but the provided range/offset exceeds the maximum value storable in an int. Either reduce the range/offset or recompile the kernel with -fsycl-id-queries-range=[uint|size_t].

The other extensions don't need the option: fft, lapack, sparse and vm compile no kernels of their own, and the only blas kernel (syrk) runs over an n x n range, where no single dimension can exceed INT_MAX. In statistics each work-item processes several elements, so the limit is reached only for very large inputs.

Validated with DPC++ 2026.2 on Intel Data Center GPU Max 1100 (Level Zero) and on CPU (OpenCL), on inputs with 2**31 + 1 elements; results are the same on both devices:

Case Module Before After
dpnp.gcd on broadcast int8 inputs ufunc failed passed
dpnp.hamming(2**31 + 1) window failed passed
dpnp.random.logistic(size=2**31 + 1) dpnp_backend_c failed passed

test_binary_ufuncs.py, test_histogram.py, test_window.py, test_product.py, test_random_state.py, test_statistics.py, test_fft.py and test_special.py pass on both devices, and the build has no new warnings.

No new tests are added: these cases need multi-GiB allocations, so as slow tests they would not run in CI and would skip on most devices.

  • 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?

With DPC++ 2026.2 the work-item ID range is recorded at the device link
step, so modules built without the option at link time fail to launch
kernels over more than INT_MAX work-items. Pass it at compile and link
time to the ufunc, window and statistics extensions and to the
dpnp_backend_c library, whose kernels can be launched over such ranges.
@antonwolfy antonwolfy self-assigned this Oct 15, 2026
@antonwolfy antonwolfy added this to the 0.21.0 release milestone Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev14=np2py314h8d9cdd5_6 ran successfully.
Passed: 1376
Failed: 0
Skipped: 6

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

No base build to compare — fix-id-queries-link-flag into master

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.

2 participants