Skip to content

Accept empty tensor bindings in CPUBackend execute (#24195) - #24195

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
JakeStevens:export-D126930703
Oct 28, 2026
Merged

meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
JakeStevens:export-D126930703

Conversation

@JakeStevens

@JakeStevens JakeStevens commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

The CPU delegate rejected any binding whose strides/dim-order were not canonical-contiguous, including empty (0-byte) tensors whose layout is meaningless: PyTorch does not canonicalize strides for 0-size dims, so e.g. a (0,0,0,0,0) input arrives with dim-order != identity and fails with 0x12 (InvalidArgument).

Skip the contiguity check for 0-byte bindings; the input/output memcpys already skip empty buffers, and providers handle 0-size execution.

Reviewed By: digantdesai

Differential Revision: D126930703

@pytorch-bot

pytorch-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 070df8b with merge base 8739d28 (image):

NEW FAILURE - The following job has failed:

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 27, 2026
@meta-codesync

meta-codesync Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@JakeStevens has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126930703.

@digantdesai digantdesai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync Bot changed the title Accept empty tensor bindings in CPUBackend execute Accept empty tensor bindings in CPUBackend execute (#24195) Oct 27, 2026
JakeStevens added a commit to JakeStevens/executorch that referenced this pull request Oct 27, 2026
Summary:

The CPU delegate rejected any binding whose strides/dim-order were not canonical-contiguous, including empty (0-byte) tensors whose layout is meaningless: PyTorch does not canonicalize strides for 0-size dims, so e.g. a (0,0,0,0,0) input arrives with dim-order != identity and fails with 0x12 (InvalidArgument).

Skip the contiguity check for 0-byte bindings; the input/output memcpys already skip empty buffers, and providers handle 0-size execution.

Reviewed By: digantdesai

Differential Revision: D126930703
JakeStevens added a commit to JakeStevens/executorch that referenced this pull request Oct 27, 2026
Summary:

The CPU delegate rejected any binding whose strides/dim-order were not canonical-contiguous, including empty (0-byte) tensors whose layout is meaningless: PyTorch does not canonicalize strides for 0-size dims, so e.g. a (0,0,0,0,0) input arrives with dim-order != identity and fails with 0x12 (InvalidArgument).

Skip the contiguity check for 0-byte bindings; the input/output memcpys already skip empty buffers, and providers handle 0-size execution.

Reviewed By: digantdesai

Differential Revision: D126930703
@JakeStevens
JakeStevens force-pushed the export-D126930703 branch 2 times, most recently from 21ced12 to 4f24839 Compare October 27, 2026 16:10
JakeStevens added a commit to JakeStevens/executorch that referenced this pull request Oct 27, 2026
Summary:

The CPU delegate rejected any binding whose strides/dim-order were not canonical-contiguous, including empty (0-byte) tensors whose layout is meaningless: PyTorch does not canonicalize strides for 0-size dims, so e.g. a (0,0,0,0,0) input arrives with dim-order != identity and fails with 0x12 (InvalidArgument).

Skip the contiguity check for 0-byte bindings; the input/output memcpys already skip empty buffers, and providers handle 0-size execution.

Reviewed By: digantdesai

Differential Revision: D126930703
JakeStevens added a commit to JakeStevens/executorch that referenced this pull request Oct 27, 2026
Summary:

The CPU delegate rejected any binding whose strides/dim-order were not canonical-contiguous, including empty (0-byte) tensors whose layout is meaningless: PyTorch does not canonicalize strides for 0-size dims, so e.g. a (0,0,0,0,0) input arrives with dim-order != identity and fails with 0x12 (InvalidArgument).

Skip the contiguity check for 0-byte bindings; the input/output memcpys already skip empty buffers, and providers handle 0-size execution.

Reviewed By: digantdesai

Differential Revision: D126930703
JakeStevens added a commit to JakeStevens/executorch that referenced this pull request Oct 27, 2026
Summary:

The CPU delegate rejected any binding whose strides/dim-order were not canonical-contiguous, including empty (0-byte) tensors whose layout is meaningless: PyTorch does not canonicalize strides for 0-size dims, so e.g. a (0,0,0,0,0) input arrives with dim-order != identity and fails with 0x12 (InvalidArgument).

Skip the contiguity check for 0-byte bindings; the input/output memcpys already skip empty buffers, and providers handle 0-size execution.

Reviewed By: digantdesai

Differential Revision: D126930703
Summary:
Pull Request resolved: pytorch#24195

The CPU delegate rejected any binding whose strides/dim-order were not canonical-contiguous, including empty (0-byte) tensors whose layout is meaningless: PyTorch does not canonicalize strides for 0-size dims, so e.g. a (0,0,0,0,0) input arrives with dim-order != identity and fails with 0x12 (InvalidArgument).

Skip the contiguity check for 0-byte bindings; the input/output memcpys already skip empty buffers, and providers handle 0-size execution.

Reviewed By: digantdesai

Differential Revision: D126930703
@meta-codesync
meta-codesync Bot merged commit 2fd9752 into pytorch:main Oct 28, 2026
217 of 218 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants