← Back to Pull requests

Align the build flags of all SYCL modules with dpnp.tensor #3198

Open
unknown opened this pull request with 349 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 24, 2026 00:13 UTC
Author

This PR aligns the compiler and linker flags of all dpnp SYCL modules with those dpnp.tensor inherited from dpctl. It is stacked on #3163: with dpnp_backend_c removed, every SYCL target is a pybind11 module in dpnp/libtensor.

Until now, only dpnp/tensor and dpnp/libtensor/source included tensor_build_flags.cmake, and the oneMKL extensions used a separate set of options:

  • The directory flags (no global -fsycl, lld, -Wno-unused-parameter, Debug -g with device -g0) move to the top-level CMakeLists.txt, so every target gets them. tensor_build_flags.cmake keeps only the coverage strip of the tensor directories; coverage is otherwise unchanged and doesn't overlap #3193.

  • Every pybind11 module, the eight of libtensor/source included, is now built by build_dpnp_pybind11_ext. It compiles the whole module with -fno-fast-math instead of -fno-approx-func -fno-finite-math-only, and adds the hardening DPNP_LDFLAGS and DPNP_TENSOR_OFFLOAD_COMPRESS, which the extensions lacked.

  • -fno-fast-math on the whole module, not on a list of sources as in dpctl: the sources left out of that list have no floating-point math worth relaxing. Both groups of sources of a libtensor module now share the floating-point flags, so an inline function both instantiate no longer depends on which copy the linker keeps. The dpnp kernels (sinc, i0, interpolate, the statistics functions, ...) and the extensions now keep signed zeros and don't reassociate.
  • The flags also caused compiler warnings in Debug and Coverage builds, which are fixed:

  • -Xsycl-target-frontend=spir64 -g0 was unused for the Cython modules and the simplify_iteration_space static library, which no longer get -fsycl; it now goes only to the SYCL modules.

  • -g1 was ignored for spir64 in every SYCL source of a coverage build (also on master); CMAKE_CXX_FLAGS_COVERAGE passes it to the host only.

  • -fno-sycl-use-footer was unused for the static library, which now takes the plain coverage flags.
  • Checked locally:

  • The Release build (234 compiles) has no compiler warnings.

  • 18 test modules (elementwise, statistics, histogram, linalg, fft, random, sort, window, ...) pass on a Level Zero GPU: 53577 passed, 230 skipped. They were not run on a CPU device, and performance was not measured.
  • 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?
  • Diff: 349 lines (+261 / -88) across 4 files Reviewer: vlad-perevezentsev Review duration: 7492m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.42) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 349 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.350
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #3198"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.4% (MEDIUM) · Higher = larger blast radius
    42.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.2% · Safe to merge
    24.2%