Skip to content

Revert "Eliminate redundant NCHW↔NHWC permute_copy and NHWC-safe view_copy transposes in ToTosaMemoryFormatPass"#18555

Merged
3l1 merged 2 commits intomainfrom
copilot/revert-eliminate-redundant-nchwch-nhwc-permute-cop
Mar 30, 2026
Merged

Revert "Eliminate redundant NCHW↔NHWC permute_copy and NHWC-safe view_copy transposes in ToTosaMemoryFormatPass"#18555
3l1 merged 2 commits intomainfrom
copilot/revert-eliminate-redundant-nchwch-nhwc-permute-cop

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

Reverts #18314.

Summary

Reverts the NHWC-safe reshape detection and redundant permute_copy elimination introduced in #18314 (ToTosaMemoryFormatPass).

Test plan

Full revert of #18314 — no new logic introduced. Relevant tests:

pytest backends/arm/test/passes/test_to_tosa_memory_format.py
pytest backends/arm/test/ -v

These require the Arm/TOSA toolchain and cannot run in the automation environment.

Original prompt

Create a revert pull request for merged PR #18314 in repository pytorch/executorch.

Requirements:

  1. Create a new branch off the default branch (main unless repo indicates otherwise).
  2. Revert the merge commit(s) introduced by PR Eliminate redundant NCHW↔NHWC permute_copy and NHWC-safe view_copy transposes in ToTosaMemoryFormatPass (#18314) #18314 ("Eliminate redundant NCHW↔NHWC permute_copy and NHWC-safe view_copy transposes in ToTosaMemoryFormatPass"). Use git revert -m 1 <merge_sha>-equivalent semantics if it was merged via a merge commit; otherwise revert the relevant commits.
  3. Ensure the revert builds/tests as per repo conventions:
    • Run the existing CI-relevant unit tests or minimal test suite if available in repo documentation.
    • If running tests is not possible in the automation environment, add a note in the PR description explaining what should be run.
  4. PR title should be: "Revert "Eliminate redundant NCHW↔NHWC permute_copy and NHWC-safe view_copy transposes in ToTosaMemoryFormatPass""
  5. PR description should include:

Acceptance criteria:

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: can you create a revert PR

Assistant: I’m waiting for you to accept the pending action request; once you do, I can proceed to create the revert pull request for #18314.

This pull request was created from Copilot chat.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

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

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Mar 28, 2026

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Cancelled Job, 2 Unrelated Failures

As of commit 109ac08 with merge base 502d2de (image):

NEW FAILURE - The following job has failed:

  • Lint / lintrunner-mypy (gh)
    >>> Lint for backends/arm/test/models/stable_diffusion/stable_diffusion_module_test_configs.py:

CANCELLED JOB - The following job was cancelled. Please retry:

BROKEN TRUNK - The following jobs 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-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 Mar 28, 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.

…_copy transposes in ToTosaMemoryFormatPass (#18314)"

This reverts commit 28b4813.

Co-authored-by: zingo <368986+zingo@users.noreply.github.com>
Copilot AI changed the title [WIP] Revert "Eliminate redundant NCHW↔NHWC permute_copy and NHWC-safe view_copy transposes in ToTosaMemoryFormatPass" Revert "Eliminate redundant NCHW↔NHWC permute_copy and NHWC-safe view_copy transposes in ToTosaMemoryFormatPass" Mar 28, 2026
Copilot AI requested a review from zingo March 28, 2026 15:23
@zingo zingo added ciflow/trunk partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm labels Mar 28, 2026
@zingo zingo requested a review from 3l1 March 28, 2026 15:27
@3l1 3l1 marked this pull request as ready for review March 29, 2026 17:03
@3l1 3l1 requested a review from digantdesai as a code owner March 29, 2026 17:03
@3l1 3l1 merged commit def3699 into main Mar 30, 2026
164 of 171 checks passed
@3l1 3l1 deleted the copilot/revert-eliminate-redundant-nchwch-nhwc-permute-cop branch March 30, 2026 16:35
rascani pushed a commit to rascani/executorch that referenced this pull request Apr 1, 2026
…_copy transposes in ToTosaMemoryFormatPass" (pytorch#18555)

Reverts pytorch#18314.

### Summary

Reverts the NHWC-safe reshape detection and redundant `permute_copy`
elimination introduced in pytorch#18314 (`ToTosaMemoryFormatPass`).

### Test plan

Full revert of pytorch#18314 — no new logic introduced. Relevant tests:

```
pytest backends/arm/test/passes/test_to_tosa_memory_format.py
pytest backends/arm/test/ -v
```

These require the Arm/TOSA toolchain and cannot run in the automation
environment.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> Create a revert pull request for merged PR
pytorch#18314 in repository
pytorch/executorch.
> 
> Requirements:
> 1) Create a new branch off the default branch (main unless repo
indicates otherwise).
> 2) Revert the merge commit(s) introduced by PR pytorch#18314 ("Eliminate
redundant NCHW↔NHWC permute_copy and NHWC-safe view_copy transposes in
ToTosaMemoryFormatPass"). Use `git revert -m 1 <merge_sha>`-equivalent
semantics if it was merged via a merge commit; otherwise revert the
relevant commits.
> 3) Ensure the revert builds/tests as per repo conventions:
> - Run the existing CI-relevant unit tests or minimal test suite if
available in repo documentation.
> - If running tests is not possible in the automation environment, add
a note in the PR description explaining what should be run.
> 4) PR title should be: "Revert \"Eliminate redundant NCHW↔NHWC
permute_copy and NHWC-safe view_copy transposes in
ToTosaMemoryFormatPass\""
> 5) PR description should include:
>    - Link to PR pytorch#18314
>    - Brief explanation that this PR reverts pytorch#18314
>    - Any conflicts resolved or follow-up actions needed.
> 
> Acceptance criteria:
> - The revert PR cleanly applies to the base branch and restores
behavior prior to pytorch#18314.
> - No unrelated formatting or refactoring changes.
> 
> 
> The following is the prior conversation context from the user's chat
exploration (may be truncated):
> 
> User: can you create a revert PR
> 
> Assistant: I’m waiting for you to accept the pending action request;
once you do, I can proceed to create the revert pull request for
pytorch#18314.
> 
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Send tasks to Copilot coding agent from
[Slack](https://gh.io/cca-slack-docs) and
[Teams](https://gh.io/cca-teams-docs) to turn conversations into code.
Copilot posts an update in your thread when it's finished.

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

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: zingo <368986+zingo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. 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.

4 participants