Skip to content

[xpu][fix] Include kernel_compile_result.h in aoti xpu.h header - #187417

Merged
atalman merged 1 commit into
release/2.13from
cherry-pick-187137-by-pytorch_bot_bot_
Jun 16, 2026
Merged

atalman merged 1 commit into
release/2.13from
cherry-pick-187137-by-pytorch_bot_bot_

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

)

# Motivation
#184735 introduces AOTI lazy autotuning with the dual-wrapper mechanism, which uncovered some new XPU test failures in CI.

# Additonal Context
Fix #187124
Fix #187123
Fix #187035
Fix #187035
Fix #187036
Fix #187125
Fix #187121

This needs to be cherry-picked to the release branch.

Pull Request resolved: #187137
Approved by: https://github.com/EikanWang, https://github.com/atalman
ghstack dependencies: #181233

(cherry picked from commit 6ec77b0)
@pytorch-bot

pytorch-bot Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/187417

Note: Links to docs will display an error until the docs builds have been completed.

❌ You can merge normally! (3 Unrelated Failures), 1 Unclassified Failure

As of commit 13ae56b with merge base 636bc91 (image):

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@jansel

jansel commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@claude review these changes

@claude

claude Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Claude finished @jansel's task in 55s —— View job


Code Review

  • Gather context (diff, related headers, test)
  • Review changes
  • Post feedback

I reviewed this cherry-pick against origin/release/2.13. Both changes are small, correct, and well-scoped fixes for the dual-wrapper AOTI lazy-autotuning mechanism introduced in #184735.

torch/csrc/inductor/aoti_include/xpu.h — ✅ Correct

#include <torch/csrc/inductor/aoti_include/common.h>
#include <torch/csrc/inductor/aoti_include/kernel_compile_result.h>  // added
#include <torch/csrc/inductor/cpp_wrapper/device_internal/xpu.h>

This makes xpu.h mirror cuda.h exactly, which already includes kernel_compile_result.h. The dual-wrapper mechanism emits code referencing LazyKernelCompileResult (defined in kernel_compile_result.h), so the XPU AOTI header was missing this struct definition — a genuine build/compile gap for XPU. The fix is the right one and is consistent with the CUDA header. The include ordering (alphabetical) is preserved. Good.

test/inductor/test_aot_inductor.py — ✅ Reasonable

@skipIfRocm  # RoCM does not support the config block size in test suite.
@skipIfXpu(
    msg="SYCL work-item index overflow issue when block sizes are used in this test."
)
def test_autotune_int64_user_defined_triton_kernel(self):

skipIfXpu is already imported (line 89) and used elsewhere in the file, so this is consistent with existing patterns. The skip parallels the existing @skipIfRocm on the same test — both back-ends have block-size limitations in this int64 autotuning test. The message clearly documents the underlying reason (SYCL work-item index overflow).

Minor observation (non-blocking): a skip rather than a fix means XPU loses coverage for this int64 path. That's acceptable for unblocking CI on the release branch, but it would be worth tracking the SYCL overflow as a follow-up so coverage can be restored. The PR body links the issues being fixed, so this seems already accounted for.

Summary

No bugs, no correctness concerns. The header fix is the substantive change and is clearly correct; the test skip is a sensible, well-documented CI unblock. This is a clean cherry-pick suitable for release/2.13.

@atalman atalman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@atalman
atalman merged commit 6673e3b into release/2.13 Jun 16, 2026
206 of 210 checks passed
@github-actions
github-actions Bot deleted the cherry-pick-187137-by-pytorch_bot_bot_ branch July 17, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants