Skip to content

Expand XPU compiler/autograd testing - #4894

Open
shangerxin wants to merge 2 commits into
mainfrom
erxin/migrate_20260810
Open

Expand XPU compiler/autograd testing#4894
shangerxin wants to merge 2 commits into
mainfrom
erxin/migrate_20260810

Conversation

@shangerxin

@shangerxin shangerxin commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces a SYCL-oriented build system for XPU ops and expands XPU test coverage around compiler infrastructure, activation checkpointing, autograd cache behavior, and PyTorch testing utilities.

Migrate required files in torch repo
test/dynamo/test_activation_checkpointing.py
test/dynamo/test_aot_autograd_cache.py
test/dynamo/test_compiler_bisector.py
test/dynamo/test_debug_utils.py
test/dynamo/test_deviceguard.py
test/dynamo/test_export.py
test/dynamo/test_regional_inductor.py
test/dynamo/test_structured_trace.py
test/dynamo/test_subclasses.py
test/dynamo/test_trace_rules.py
test/test_testing.py

Compare Link

329d891...pull/4894/head

Changes

Added

  • test/xpu/dynamo/test_activation_checkpointing_xpu.py
    New, very large test suite for activation checkpointing, selective checkpointing, rematerialization, region memory budgets, non-strict tracing, nested compile, and many edge cases.

Modified

  • test/xpu/test_testing_xpu.py
    Greatly expands generic testing coverage: assert-close/assert-equal, sparse tensors, quantized tensors, parametrization, opinfo, hardware classification, and import behavior.
  • test/xpu/skip_list_common.py
    Updates skip entries for moved/renamed test files and adds skips for the new XPU dynamo/debug-related tests.

Deleted

test/xpu/dynamo/test_aot_autograd_cache_xpu.py
test/xpu/dynamo/test_compiler_bisector_xpu.py
test/xpu/dynamo/test_deviceguard_xpu.py
test/xpu/dynamo/test_regional_inductor_xpu.py

What this means overall

The PR consolidates older Dynamo/inductor test coverage into a new activation-checkpointing-focused test file.
It also broadens AOT-autograd cache validation and general testing utilities coverage.
Some old test modules are removed because their scenarios were absorbed into the new files.

Bugs

#4943
#4945

@shangerxin shangerxin added disable_e2e Disable all e2e test jobs for the PR disable_distributed Disable distributed UT test jobs for the PR disable_build Disable source code build for CI test, use nightly wheel disable_auto Disable auto label workflow for PR disable_win Disable Windows CI test jobs for the PR labels Aug 10, 2026
@shangerxin
shangerxin force-pushed the erxin/migrate_20260810 branch from 7f323a1 to 842bced Compare August 11, 2026 03:01
@shangerxin

Copy link
Copy Markdown
Contributor Author

@copilot please fix the lint issue.

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@copilot please fix the lint issue.

Fixed in the latest commit. The issues were:

  • Tab character on line 357 of skip_list_common.py (replaced with spaces)
  • Unused onlyCUDA import in test_testing_xpu.py (removed)
  • Missing onlyOn import in test_testing_xpu.py (added to the common_device_type import)

@shangerxin

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@copilot please fix the lint job https://github.com/intel/torch-xpu-ops/actions/runs/31455650407/job/93668736816?pr=4894 failures for this pr.

Fixed in the latest commit. Two issues were addressed:

  1. Remaining tab character in test/xpu/test_testing_xpu.py line 426 (inside an inline test string)
  2. CLANGTIDY cppcoreguidelines-prefer-member-initializer error in src/ATen/native/xpu/sycl/FFTKernelFunctor.cpp — moved mirror_dim_ initialization to the member initializer list

@shangerxin

Copy link
Copy Markdown
Contributor Author

@copilot fix the lint issues for the files changed in this PR. The lint job is https://github.com/intel/torch-xpu-ops/actions/runs/31467356782/job/93702938446?pr=4894

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the lint issues for the files changed in this PR. The lint job is https://github.com/intel/torch-xpu-ops/actions/runs/31467356782/job/93702938446?pr=4894

Fixed in commit Fix CLANGTIDY mirror_dim_ member initializer lint error. Moved mirror_dim_ initialization to the member initializer list (: mirror_dim_(0)) to satisfy the cppcoreguidelines-prefer-member-initializer rule.

@shangerxin

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the lint errors in this https://github.com/intel/torch-xpu-ops/actions/runs/31568622333/job/94025635331?pr=4894 .

Fixed in the latest commit:

  1. FFTKernelFunctor.cpp: Changed mirror_dim_ to use a default member initializer at declaration (uint32_t mirror_dim_ = 0;) to satisfy modernize-use-default-member-init
  2. test_testing_xpu.py line 426: Replaced remaining tab character with spaces

@shangerxin

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@copilot please summarize the top n failures for the files test_* in this pr. the UT jobs are https://github.com/intel/torch-xpu-ops/actions/runs/31571224115/job/94041674226?pr=4894 and https://github...

Here's a summary of the top failures across both UT jobs:


Job 94073605582 — 35 new failures

1. test_aot_autograd_cache — 10 failures (AOTAutogradCacheTests + AOTAutogradCacheBundledTests)
All are variants of test_cache_hit_across_processes_pre_grad_custom_pass_* (with/without UUID, default/early/late).

2. test_activation_checkpointing_xpu — 2 failures

  • RematerializeACNodesPassTests.test_attr_compile_submodules_in_checkpoint_wrapper
  • RematerializeACNodesPassTests.test_ac_rematerialize_with_sdpa_dropout_zero

3. polar op — 13 failures across multiple test files (test_binary_ufuncs_xpu, test_tensor_creation_ops_xpu, test_schema_check, test_decomp_xpu, test_meta_xpu, test_ops_xpu) all for polar_xpu_float16.

4. test_export — 1 failure

  • ExportTestsSubprocess.test_strict_export_under_pythonoptimize

5. test_aotdispatch_xpu — 1 failure

  • TestAOTAutogradWithCache.test_input_mutation_noncontiguous

6. test_profiler_xpu — 2 failures

  • TestProfiler.test_profiler_cuda_sync_events
  • TestProfiler.test_disable_external_correlation

Job 94041674226 — 1 new failure (op_extended)

7. test_ops_xpu (extended) — 1 new failure

  • TestCommonXPU.test_compare_cpu_polar_xpu_float16

(4 other failures in test_ops_xpu were pre-existing known issues and skipped.)


Top failure categories by frequency:

  1. polar op on float16 — 14 occurrences across multiple test suites (likely a missing or incorrect XPU kernel implementation)
  2. AOTAutogradCache cross-process cache tests — 10 occurrences
  3. test_activation_checkpointing_xpu — 2 new test failures introduced by this PR
  4. Profiler CUDA-named tests on XPU — 2 failures (likely need to be skipped or adapted for XPU)

@shangerxin

shangerxin commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

The test_aot_autograd_cache failures are relative to errors and the case of test_export also failed with same error.

Need to check the test infrastructure.

ModuleNotFoundError: No module named 'functorch.compile'

…lready support xpu on upstream

Update the skip list with upstream items, removed the one file which already supported in upstream

merege stashed changes

Fix gpu type is not imported issue

Add devices and allow xpu flag

Fix the merge issues

Fix lint issues: tab indentation and import errors in test files

Co-authored-by: shangerxin <3085654+shangerxin@users.noreply.github.com>

Fix CLANGTIDY mirror_dim_ member initializer lint error in FFTKernelFunctor.cpp

Move mirror_dim_ initialization to member initializer list to fix the
cppcoreguidelines-prefer-member-initializer lint error.

Test Plan:
Lint checked via CI at https://github.com/intel/torch-xpu-ops/actions/runs/31467356782/job/93702938446

This PR was authored with an AI assistant.

Co-authored-by: shangerxin <3085654+shangerxin@users.noreply.github.com>

Fix remaining lint errors: tabs in test_testing_xpu.py and FFTKernelFunctor.cpp

- Replace tab with spaces on line 426 of test/xpu/test_testing_xpu.py
- Use default member initializer for mirror_dim_ at declaration
  (modernize-use-default-member-init) instead of constructor initializer list

This PR was authored with an AI assistant.

Co-authored-by: shangerxin <3085654+shangerxin@users.noreply.github.com>

Fix lint issue and revert the changes fort the test_testing_xpu.py

Fix lint issue
@shangerxin
shangerxin force-pushed the erxin/migrate_20260810 branch from c2eab35 to f7ad2b0 Compare August 13, 2026 07:44
@shangerxin

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

@copilot please summarize the top n failures into a table for the files test_* in this pr. the UT jobs are [https://github.com/intel/torch-xpu-ops/actions/runs/31571224115/job/94041674226?pr=4894 and ...

Here's the failure summary table for the latest UT runs (jobs 94394787611 and 94447532967):


Job 94394787611 (op_extended) — 1 new failure

# Test File Test Class Test Case Count
1 test_ops_xpu (extended) TestCommonXPU test_compare_cpu_polar_xpu_float16 1

Job 94447532967 (op_ut) — 30 new failures

# Category Test File Test Class Test Cases Count
1 polar op / float16 test_binary_ufuncs_xpu, test_tensor_creation_ops_xpu, test_schema_check, test_decomp_xpu, test_meta_xpu, test_ops_xpu Multiple polar_xpu_float16 variants 19
2 AOT Autograd Cache test_aot_autograd_cache AOTAutogradCacheTests, AOTAutogradCacheBundledTests test_cache_hit_across_processes_pre_grad_custom_pass_* (default/early/late, with/without uuid) 10
3 Export test_export ExportTestsSubprocess test_strict_export_under_pythonoptimize 1

Observations vs. previous run:

  • The 2 test_activation_checkpointing_xpu failures and 2 test_profiler_xpu failures from the previous run are now gone (fixed or filtered).
  • The polar_xpu_float16 failures (19 in op_ut + 1 in op_extended) and the AOTAutogradCache cross-process failures (10) and test_export (1) remain consistent across runs and are not caused by this PR's test files.
  • The AOTAutogradCache and test_export failures are caused by ModuleNotFoundError: No module named 'functorch.compile' — a test infrastructure issue as noted in comment #5276925378.

@shangerxin

Copy link
Copy Markdown
Contributor Author

The remain test failures relative to this PR test_aot_autograd_cache.py and test_export.py are due to below error.

The test_aot_autograd_cache failures are relative to errors and the case of test_export also failed with same error.

Need to check the test infrastructure.

ModuleNotFoundError: No module named 'functorch.compile'

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

Labels

disable_auto Disable auto label workflow for PR disable_build Disable source code build for CI test, use nightly wheel disable_distributed Disable distributed UT test jobs for the PR disable_e2e Disable all e2e test jobs for the PR disable_win Disable Windows CI test jobs for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants