Apply upstream Inductor fix for adaptive_avg_pool2d flatten-sum wrong results#3498
Draft
Apply upstream Inductor fix for adaptive_avg_pool2d flatten-sum wrong results#3498
Conversation
Agent-Logs-Url: https://github.com/intel/torch-xpu-ops/sessions/73f03483-85bd-499d-838a-2595423da853 Co-authored-by: laifenxiawucha <184592536+laifenxiawucha@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix wrong result for adaptive_avg_pool2d on XPU
Apply upstream Inductor fix for adaptive_avg_pool2d flatten-sum wrong results
Apr 28, 2026
Performance outliers, please check!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
torch.compile(..., backend="inductor")on XPU can return silent wrong results foradaptive_avg_pool2d(x, 7).flatten(1).sum(dim=-1)even though CPU and XPU eager are correct. The failure matches the upstream Inductor contiguous/exact-stride bug fixed in pytorch/pytorch#180898.What changes
pytorch/pytorch#180898to the default patch list applied by/home/runner/work/torch-xpu-ops/torch-xpu-ops/.github/scripts/apply_torch_pr.py.Why this is the right layer
Operational impact
apply_torch_pr.pywill now include the upstream Inductor fix without any additional wiring.Patched upstream PR