Skip to content

SYCL backend (2/6): CI on the SYCL CPU device - #993

Merged
AnderBiguri merged 3 commits into
CERN:syclfrom
Einse57:sycl-pr2-ci-v331
Nov 29, 2026
Merged

AnderBiguri merged 3 commits into
CERN:syclfrom
Einse57:sycl-pr2-ci-v331

Conversation

@Einse57

@Einse57 Einse57 commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Second of six PRs for the SYCL backend (#885). 1/6 is #902. This one adds a CI workflow for the SYCL build and makes the sdist include the SYCL sources. It is 3 commits on top of 1/6.

  • .github/workflows/sycl.yml builds TIGRE with TIGRE_BACKEND=sycl on ubuntu-latest and windows-latest and runs pytest on the SYCL CPU device. GitHub-hosted runners have no GPU, so the tests marked gpu run on the CPU device. The oneAPI DPC++ compiler 2025.2 and the Intel OpenCL CPU runtime come from conda-forge, through micromamba.
    • It runs when Common/**, setup.py, pyproject.toml, Python/tigre/utilities/cuda_interface/** or the workflow change, on pull requests and pushes to master, and on demand (workflow_dispatch).
    • TIGRE_REPEAT_CALLS=50, because the default of 2000 calls in test_ax_repeatable.py takes long on the CPU device.
    • Windows: icx 2025.2 rejects the STL of MSVC 14.52 and later, so the workflow uses the newest installed toolset below 14.52. It also registers the OpenCL CPU runtime with the ICD loader.
    • PyTorch: the main suite runs without it. Importing torch into the same process as the Intel OpenCL runtime aborts on Windows in numpy.linalg.svd. The six CPU-only tests in test_pytorch_bindings.py run afterwards in their own process, with the CPU wheel of torch. Without torch, pytest.importorskip skips that whole module as one test.
  • setup.py: the sdist header list only had Common/CUDA headers. It now also lists the .cpp/.hpp/.h files in Common/SYCL, so an sdist builds with TIGRE_BACKEND=sycl.
  • MANIFEST.in: adds recursive-include lines for Common/CUDA and Common/SYCL, for PEP 517 builders (e.g. uv build --sdist) that don't go through python setup.py sdist. The file keeps its current content. It needs no line for head.mat, since it is now inside the package.

The Common/SYCL code and the Python files are not touched, and neither is Common/CUDA. The pending-extension scaffolding from 1/6 (SYCL_PENDING, _import_extension, the conftest.py skips) stays until 5/6. The workflow trigger on pushes names master, so pushes to sycl itself don't start it, only pull requests do.

Which parts of TIGRE does it touch?

  • Python
  • MATLAB
  • CUDA kernels (Common/CUDA)
  • Docs / demos only

CI workflow and packaging only (.github/workflows/sycl.yml, setup.py, MANIFEST.in).

Checklist

  • Tested locally (see below)
  • Added or updated tests where it makes sense (CI only)
  • If this adds a feature to one language, the other one is updated too, or there is an issue to track it (n/a)
  • Demos and docs updated if user-facing behaviour changed (n/a)
  • TIGRE.bib updated (n/a)
  • Entry added to changelog.md (docs and changelog come in 6/6)

Test environment

Builds TIGRE with TIGRE_BACKEND=sycl on ubuntu-latest and windows-latest and
runs pytest on the SYCL CPU device (Intel OpenCL CPU runtime), with the
oneAPI DPC++ compiler from conda-forge. Runs when Common/, the build or the
workflow change, and on demand.
The sdist header list in setup.py named only Common/CUDA headers, so a source
distribution would not have Common/SYCL (including page_locking.hpp). The list
now includes every .cpp/.hpp in Common/SYCL. MANIFEST.in includes those files
for PEP 517 builders (uv build --sdist) that do not pass "sdist" as sys.argv[1].
test_pytorch_bindings.py is a CPU-only check of the autograd bindings (Ax and
Atb are replaced by a dense matrix). Without torch, pytest.importorskip skips
the whole module as one test, so the six tests are not collected.

The main suite runs first, without torch: importing torch into the same
process as the Intel OpenCL runtime aborts on Windows in numpy.linalg.svd.
The six binding tests then run in their own process after a CPU-wheel install.
@AnderBiguri

Copy link
Copy Markdown
Member

Thanks, merged. Two small things for a later PR: could you add sycl to the push branches, so merges of master into sycl get tested, and a concurrency group like tests.yml has? The include_headers addition in setup.py also looks redundant now that MANIFEST.in includes Common/SYCL.

@AnderBiguri
AnderBiguri merged commit ee754cc into CERN:sycl Nov 29, 2026
7 checks passed
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