Skip to content

Add test_sycl_extension from test_cpp_extensions_aot for XPU#2927

Open
astachowiczhabana wants to merge 11 commits intomainfrom
astachowiczhabana/issue2574
Open

Add test_sycl_extension from test_cpp_extensions_aot for XPU#2927
astachowiczhabana wants to merge 11 commits intomainfrom
astachowiczhabana/issue2574

Conversation

@astachowiczhabana
Copy link
Contributor

@astachowiczhabana astachowiczhabana commented Feb 25, 2026

Fixes #2574

Adds test_sycl_extension from upstream test_cpp_extensions_aot.py to XPU CI.

Unlike other _xpu tests that import upstream classes via XPUPatchForImport, this test requires AOT C++ extensions to be compiled first. The wrapper handles this by building them in setUpClass (mirroring upstream run_test.py logic), so no CI changes are needed.

Changes:

  • test/xpu/test_cpp_extensions_aot_xpu.py — self-contained wrapper that builds extensions and runs test_sycl_extension
  • test/xpu/skip_list_common.py — register new test file

Disable_e2e
Disable_distributed

Add a self-contained wrapper that builds the AOT C++ extensions
in setUpClass and runs test_sycl_extension on XPU. Register the
new test file in skip_list_common.py so it is picked up by
run_test_with_skip.py in CI.
Copilot AI review requested due to automatic review settings February 25, 2026 08:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an XPU-specific test wrapper intended to exercise the upstream-style AOT C++/SYCL extension build and run test_sycl_extension as part of XPU CI.

Changes:

  • Add test/xpu/test_cpp_extensions_aot_xpu.py to attempt building the SYCL AOT extension in setUpClass and run a basic sigmoid_add correctness check on XPU.
  • Register the new test file in the XPU test runner’s skip_dict so it is executed in XPU CI.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
test/xpu/test_cpp_extensions_aot_xpu.py New wrapper test that attempts to build and import torch_test_cpp_extension.sycl before running an XPU correctness assertion.
test/xpu/skip_list_common.py Adds the new test file to the XPU CI test list (skip_dict).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Adam Stachowicz and others added 2 commits February 25, 2026 12:00
- Catch ModuleNotFoundError instead of broad ImportError
- Remove try/except around build so failures surface as test errors
- Defer sys.path insertion from import time to setUpClass
@EikanWang EikanWang added the windows_ci Only for Windows CI trigger label Feb 25, 2026
@EikanWang
Copy link
Contributor

EikanWang commented Feb 26, 2026

@astachowiczhabana , could you help add a dedicated section to the workflow for this case? Since we are suffering from a Windows CI issue, the test script of this PR cannot be verified. But a dedicated section like https://github.com/intel/torch-xpu-ops/blob/main/.github/workflows/_windows_ut.yml#L238-L251 before https://github.com/intel/torch-xpu-ops/blob/main/.github/workflows/_windows_ut.yml#L238C14-L238C37 could help workaround the Windows CI issue first to verify this PR.

@astachowiczhabana
Copy link
Contributor Author

astachowiczhabana commented Feb 26, 2026

Thx @EikanWang for the review. I've added a dedicated "Run CPP Extensions AOT SYCL UT" step in _windows_ut.yml before the existing test steps, using pytest with --junit-xml for XML output collection.

@intel intel deleted a comment from github-actions bot Feb 27, 2026
@github-actions
Copy link

Performance outliers, please check!

  • 🔴 [-1, 80%), should be regression
Category Model Target vs. Baseline [Eager] Target vs. Baseline [Inductor]
torchbench_bfloat16_training mnasnet1_0 0.95818 0.783364
  • 🟡 [80%, 90%), may be fluctuations
Category Model Target vs. Baseline [Eager] Target vs. Baseline [Inductor]
torchbench_bfloat16_training dcgan 0.841575 0.804221
torchbench_bfloat16_training resnet18 0.929294 0.836664
torchbench_bfloat16_training resnext50_32x4d 0.955966 0.846038
torchbench_bfloat16_training densenet121 0.814297 0.873977
torchbench_bfloat16_training mobilenet_v3_large 0.964138 0.885686

@github-actions
Copy link

Performance outliers, please check!

  • 🔴 [-1, 80%), should be regression
Category Model Target vs. Baseline [Eager] Target vs. Baseline [Inductor]
torchbench_bfloat16_training mnasnet1_0 0.967245 0.782921
torchbench_bfloat16_training resnet18 0.909063 0.799914
  • 🟡 [80%, 90%), may be fluctuations
Category Model Target vs. Baseline [Eager] Target vs. Baseline [Inductor]
torchbench_bfloat16_training dcgan 0.858456 0.810524
torchbench_bfloat16_training densenet121 0.804364 0.851339
torchbench_bfloat16_training resnext50_32x4d 0.953772 0.861319
torchbench_bfloat16_training mobilenet_v3_large 0.964143 0.895925

Copy link
Contributor

@dvrogozh dvrogozh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we duplicate the test which is available in pytorch upstream? Is this a workaround for Windows CI?

@github-actions
Copy link

Performance outliers, please check!

  • 🟡 [80%, 90%), may be fluctuations
Category Model Target vs. Baseline [Eager] Target vs. Baseline [Inductor]
torchbench_bfloat16_training resnet18 0.958637 0.835658
torchbench_bfloat16_training mnasnet1_0 1.016375 0.883571

@astachowiczhabana
Copy link
Contributor Author

Why do we duplicate the test which is available in pytorch upstream? Is this a workaround for Windows CI?

We don't have Windows tests in upstream

@chuanqi129
Copy link
Contributor

Hi @astachowiczhabana , seems the new added test case failed on Linux https://github.com/intel/torch-xpu-ops/actions/runs/22493742531/job/65192747065?pr=2927#step:4:3946, please double check it

Copilot AI review requested due to automatic review settings March 6, 2026 00:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@astachowiczhabana
Copy link
Contributor Author

astachowiczhabana commented Mar 6, 2026

@chuanqi129 Thanks for catching that. The test is no longer failing on Ubuntu — I've removed it from skip_list_common in the latest commit (adc0bdb), so it won't be picked up by the Ubuntu CI runner anymore. The test will now only run on Windows via the dedicated "Run CPP Extensions AOT SYCL UT" step in _windows_ut.yml.

We only need this test on Windows to verify that the upstream fix (pytorch/pytorch#175333) resolves the oneAPI 2025.3 build issue there. We don't need it on Ubuntu because test_sycl_extension already passes there in upstream CI. Once pytorch/pytorch#175333 is merged, we'll work on enabling Windows XPU CI in upstream as well.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Performance outliers, please check!

  • 🟡 [80%, 90%), may be fluctuations
Category Model Target vs. Baseline [Eager] Target vs. Baseline [Inductor]
torchbench_bfloat16_training resnet18 0.95936 0.898549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

windows_ci Only for Windows CI trigger

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sycl-extension][win] Build failure with Intel oneAPI 2025.3 and MSVC 2022 due to immintrin.h conflicts (2025.2 works)

6 participants