Skip to content

Materialize zero bias for conv replacement (#23354) - #23354

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
pcwu0329:export-D110672307
Oct 3, 2026
Merged

meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
pcwu0329:export-D110672307

Conversation

@pcwu0329

@pcwu0329 pcwu0329 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

aten::convolution declares Tensor? bias, so a conv built with bias=False lowers to a node whose bias argument is None. cadence::conv1d/conv2d/conv3d declare a non-optional Tensor bias, with no way to express absence. Replacing a biasless convolution therefore yields a node that strict Edge validation rejects for schema mismatch.

Materialize an explicit zero bias via edge.aten.full.default, sized to the convolution's output channels and typed from the weight, so the replacement is schema-valid. Adding zeros is numerically a no-op.

If the Cadence kernels gain optional-bias support, as discussed on the diff, this method can be deleted outright.

Reviewed By: DrJessop

Differential Revision: D110672307

@pytorch-bot

pytorch-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

As of commit 590bcaf with merge base 305638c (image):
💚 Looks good so far! There are no failures yet. 💚

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 2, 2026
@meta-codesync

meta-codesync Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Oct 2, 2026

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.

pcwu0329 added a commit to pcwu0329/executorch that referenced this pull request Oct 2, 2026
Summary:
Pull Request resolved: pytorch#23354

When replacing biasless `aten.convolution` with Cadence convolution, materialize an explicit zero bias tensor so strict Edge validation sees a schema-compatible Cadence conv. This keeps strict validation enabled for QAT compile paths that leave some backbone convolutions FP32.

Differential Revision: D110672307
@meta-codesync meta-codesync Bot changed the title Materialize zero bias for conv replacement Materialize zero bias for conv replacement (#23354) Oct 2, 2026
@pcwu0329
pcwu0329 requested review from DrJessop, JacobSzwejbka and zonglinpeng and removed request for DrJessop October 2, 2026 07:53
pcwu0329 added a commit to pcwu0329/executorch that referenced this pull request Oct 2, 2026
Summary:

When replacing biasless `aten.convolution` with Cadence convolution, materialize an explicit zero bias tensor so strict Edge validation sees a schema-compatible Cadence conv. This keeps strict validation enabled for QAT compile paths that leave some backbone convolutions FP32.

Differential Revision: D110672307
pcwu0329 added a commit to pcwu0329/executorch that referenced this pull request Oct 2, 2026
Summary:
Pull Request resolved: pytorch#23354

When replacing biasless `aten.convolution` with Cadence convolution, materialize an explicit zero bias tensor so strict Edge validation sees a schema-compatible Cadence conv. This keeps strict validation enabled for QAT compile paths that leave some backbone convolutions FP32.

Differential Revision: D110672307
pcwu0329 added a commit to pcwu0329/executorch that referenced this pull request Oct 2, 2026
Summary:

When replacing biasless `aten.convolution` with Cadence convolution, materialize an explicit zero bias tensor so strict Edge validation sees a schema-compatible Cadence conv. This keeps strict validation enabled for QAT compile paths that leave some backbone convolutions FP32.

Differential Revision: D110672307
pcwu0329 added a commit to pcwu0329/executorch that referenced this pull request Oct 2, 2026
Summary:
Pull Request resolved: pytorch#23354

When replacing biasless `aten.convolution` with Cadence convolution, materialize an explicit zero bias tensor so strict Edge validation sees a schema-compatible Cadence conv. This keeps strict validation enabled for QAT compile paths that leave some backbone convolutions FP32.

Differential Revision: D110672307
pcwu0329 added a commit to pcwu0329/executorch that referenced this pull request Oct 2, 2026
Summary:

`aten::convolution` declares `Tensor? bias`, so a conv built with `bias=False` lowers to a node whose bias argument is `None`. `cadence::conv1d/conv2d/conv3d` declare a non-optional `Tensor bias`, with no way to express absence. Replacing a biasless convolution therefore yields a node that strict Edge validation rejects for schema mismatch.

Materialize an explicit zero bias via `edge.aten.full.default`, sized to the convolution's output channels and typed from the weight, so the replacement is schema-valid. Adding zeros is numerically a no-op.

If the Cadence kernels gain optional-bias support, as discussed on the diff, this method can be deleted outright.

Reviewed By: DrJessop

Differential Revision: D110672307
Summary:
Pull Request resolved: pytorch#23354

`aten::convolution` declares `Tensor? bias`, so a conv built with `bias=False` lowers to a node whose bias argument is `None`. `cadence::conv1d/conv2d/conv3d` declare a non-optional `Tensor bias`, with no way to express absence. Replacing a biasless convolution therefore yields a node that strict Edge validation rejects for schema mismatch.

Materialize an explicit zero bias via `edge.aten.full.default`, sized to the convolution's output channels and typed from the weight, so the replacement is schema-valid. Adding zeros is numerically a no-op.

If the Cadence kernels gain optional-bias support, as discussed on the diff, this method can be deleted outright.

Reviewed By: DrJessop

Differential Revision: D110672307
@meta-codesync
meta-codesync Bot merged commit 0b3d26d into pytorch:main Oct 3, 2026
213 of 215 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