← Back to Pull requests

Refactor SYCL flag handling for host and device compilation #5062

Closed
unknown closed this pull request without merging on Sep 11, 2026 02:55 UTC
View on GitHub
unknown unknown commented on Aug 21, 2026 08:02 UTC
Author

Motivation


PR #2994 removed -fsycl-host-compiler and enabled pure icpx compilation for SYCL kernels. Host flags were initially merged into the SYCL compiler flags because icpx compiles both host and device code.

However, host and device compilation may require different options. For example, a Debug build may use -O0 -g for host code while keeping device code optimized without debug information. Passing all flags through one list prevents such configurations and may incorrectly apply host-only options to the device frontend.

This PR separates host flags from common/device flags. Host options are forwarded individually with -Xarch_host, while SYCL_COMPILE_FLAGS contains only common and device compilation options.

Additional warning fixes

Forwarding the complete host flag set to the icpx host frontend exposed three additional categories of warnings.

GCC-only warning options

Some warning options inherited from PyTorch are supported by GCC but not by the Intel SYCL/Clang host frontend. Passing them through -Xarch_host produced an unknown-warning-option diagnostic for every SYCL translation unit.

These options are now excluded only when constructing the icpx command. They remain available to regular sources compiled by GCC.

SYCL-TLA third-party warnings

The Clang host frontend reports additional warnings in the third-party SYCL-TLA/CUTLASS headers. With WERROR=1, those warnings prevented the SYCL-TLA target from compiling.

The affected diagnostics are demoted with -Wno-error=* only for the torch-xpu-ops-sycltla target. They remain visible as warnings, and other SYCL targets are unaffected.

Host-pass source diagnostics

The Clang host pass also detected warnings in torch-xpu-ops sources that were not reported by the previous GCC host compiler.

These were fixed locally instead of disabling their warning classes globally:

  • annotate helpers that are used only by the SYCL device pass;

  • remove an unused lambda capture;

  • remove unused functor fields, constructor state, and constants;

  • preserve existing interfaces where message support has not yet been implemented.
  • Diff: 279 lines (+209 / -70) across 3 files Reviewer: tahonermann Review duration: 29933m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 279 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.337
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5062"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 39.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.7% · Safe to merge
    15.7%