Skip to content

Quantize aten.concat like aten.cat for Ethos-U#20600

Merged
meta-codesync[bot] merged 1 commit into
mainfrom
export-D110085289
Jun 30, 2026
Merged

Quantize aten.concat like aten.cat for Ethos-U#20600
meta-codesync[bot] merged 1 commit into
mainfrom
export-D110085289

Conversation

@3l1

@3l1 3l1 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary:
The ARM PT2E quantization annotator gives a SharedQuantizationSpec to aten.cat.default, aten.concatenate.default, and aten.stack.default, so every concat input and the output share one scale/zero-point. That shared annotation is what lets a quantized concat lower to a single TOSA CONCAT and stay inside one Ethos-U delegate.

aten.concat.default was missing from that tuple. torch.concat is captured as aten.concat.default under dynamic-shape tracing (the path the EMG cascade detector PTQ uses for its emg_features/imu_features fusion at networks.py:251), so that concat received independent observers for each input and the output. The three distinct scales cannot be expressed as one TOSA CONCAT — the ARM backend has no rescale-before-concat — so the partitioner strands the op on CPU as dequantize/cat/quantize and the detector splits into two Ethos-U delegates instead of one. Under static-shape tracing the same source op is captured as aten.cat.default, which is why this only reproduces on the production (dynamic-shape) lowering path.

Add aten.concat.default next to the existing aliases so it gets the same shared spec. Applied to both the fbcode and xplat mirrors.

Differential Revision: D110085289

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

Summary:
The ARM PT2E quantization annotator gives a `SharedQuantizationSpec` to `aten.cat.default`, `aten.concatenate.default`, and `aten.stack.default`, so every concat input and the output share one scale/zero-point. That shared annotation is what lets a quantized concat lower to a single TOSA `CONCAT` and stay inside one Ethos-U delegate.

`aten.concat.default` was missing from that tuple. `torch.concat` is captured as `aten.concat.default` under dynamic-shape tracing (the path the EMG cascade detector PTQ uses for its `emg_features`/`imu_features` fusion at `networks.py:251`), so that concat received independent observers for each input and the output. The three distinct scales cannot be expressed as one TOSA `CONCAT` — the ARM backend has no rescale-before-concat — so the partitioner strands the op on CPU as dequantize/cat/quantize and the detector splits into two Ethos-U delegates instead of one. Under static-shape tracing the same source op is captured as `aten.cat.default`, which is why this only reproduces on the production (dynamic-shape) lowering path.

Add `aten.concat.default` next to the existing aliases so it gets the same shared spec. Applied to both the `fbcode` and `xplat` mirrors.

Differential Revision: D110085289
@3l1 3l1 requested a review from digantdesai as a code owner June 29, 2026 19:18
@pytorch-bot

pytorch-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit 7185bad with merge base 035b45a (image):
💚 Looks good so far! There are no failures yet. 💚

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

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 29, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: 3l1 / name: Eli Amesefe (7185bad)

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

meta-codesync Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Jun 29, 2026
@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 merged commit b3e11d3 into main Jun 30, 2026
785 of 792 checks passed
@meta-codesync meta-codesync Bot deleted the export-D110085289 branch June 30, 2026 05:47
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. meta-exported module: arm Issues related to arm backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants