Skip to content

Decompose sigmoid to exp+reciprocal to fix U85 TABLE bug (#19618)#19618

Open
christine-long-meta wants to merge 1 commit into
pytorch:mainfrom
christine-long-meta:export-D105021646
Open

Decompose sigmoid to exp+reciprocal to fix U85 TABLE bug (#19618)#19618
christine-long-meta wants to merge 1 commit into
pytorch:mainfrom
christine-long-meta:export-D105021646

Conversation

@christine-long-meta
Copy link
Copy Markdown
Contributor

@christine-long-meta christine-long-meta commented May 15, 2026

Summary:

Add DecomposeSigmoidPass that decomposes sigmoid(x) into reciprocal(add(exp(neg(x)), 1)).
This bypasses the broken Vela U85 sigmoid TABLE op by decomposing into
primitive ops whose individual TABLE implementations work correctly on U85.

The pass runs in both the TFA pipeline (before quantization, so exp/reciprocal get
individually annotated for a16w8) and the TOSA pipeline (for FP path).

Differential Revision: D105021646

@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 May 15, 2026
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 15, 2026

🔗 Helpful Links

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

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

❌ 5 New Failures, 2 Cancelled Jobs, 1 Unrelated Failure

As of commit b5c3f62 with merge base dbcf6ac (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 15, 2026

@christine-long-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105021646.

@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.

@zingo zingo added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label May 18, 2026
@oscarandersson8218
Copy link
Copy Markdown
Collaborator

Thanks for your contribution @christine-long-meta! This PR seems a bit incomplete as it only modifies tests while the description suggest that there should be changes to passes. Does the PR currently include all the changes you want to make?

@meta-codesync meta-codesync Bot changed the title Decompose sigmoid to exp+reciprocal to fix U85 TABLE bug Decompose sigmoid to exp+reciprocal to fix U85 TABLE bug (#19618) May 21, 2026
christine-long-meta added a commit to christine-long-meta/executorch that referenced this pull request May 21, 2026
Summary:

Add DecomposeSigmoidPass that decomposes sigmoid(x) into reciprocal(add(exp(neg(x)), 1)).
This bypasses the broken Vela U85 sigmoid TABLE op by decomposing into
primitive ops whose individual TABLE implementations work correctly on U85.

The pass runs in both the TFA pipeline (before quantization, so exp/reciprocal get
individually annotated for a16w8) and the TOSA pipeline (for FP path).

Differential Revision: D105021646
@christine-long-meta
Copy link
Copy Markdown
Contributor Author

christine-long-meta commented May 21, 2026

Thanks for your contribution @christine-long-meta! This PR seems a bit incomplete as it only modifies tests while the description suggest that there should be changes to passes. Does the PR currently include all the changes you want to make?

@oscarandersson8218 thanks for catching that. I guess the export function went wrong and only exported half. Let me try to fix that

Summary:

Add DecomposeSigmoidPass that decomposes sigmoid(x) into reciprocal(add(exp(neg(x)), 1)).
This bypasses the broken Vela U85 sigmoid TABLE op by decomposing into
primitive ops whose individual TABLE implementations work correctly on U85.

The pass runs in both the TFA pipeline (before quantization, so exp/reciprocal get
individually annotated for a16w8) and the TOSA pipeline (for FP path).

Differential Revision: D105021646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants