Skip to content

[cuda_xpu_alignment] Fix replication_pad{2d,3d} meta accepting negative output dims - #28

Draft
Stonepia wants to merge 1 commit into
mainfrom
agent/issue-2
Draft

[cuda_xpu_alignment] Fix replication_pad{2d,3d} meta accepting negative output dims#28
Stonepia wants to merge 1 commit into
mainfrom
agent/issue-2

Conversation

@Stonepia

@Stonepia Stonepia commented May 20, 2026

Copy link
Copy Markdown
Collaborator

[cuda_xpu_alignment] Fix replication_pad{2d,3d} meta accepting negative output dims

Fixes https://github.com/intel-sandbox/agentic_xpu/issues/2

Root Cause: The TORCH_CHECK / torch._check for output dimensions in replication_pad2d and replication_pad3d uses || (or) instead of && (and). This means the check passes if ANY dimension is >= 1, when it should require ALL dimensions to be >= 1. When only one dimension is negative, the check passes and a tensor with negative dimensions is created, causing downstream failures in FakeTensor/torch.compile.


Diff stat:

aten/src/ATen/native/ReplicationPadding.cpp | 6 +++---
 torch/_meta_registrations.py                | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

[cuda_xpu_alignment] Fix `replication_pad{2d,3d}` meta accepting negative output dims
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant