pytorch / pytorch/executorch

[Memory-layout infra] Handle graphs not exportable in channels-last format

Open
#20,096 0 comments 0 reactions 1 assignee View on GitHub

@MartinPavella is already working on this.

Since Jul 23, 2026.

Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

Part of #19299. Some graphs are not exportable in channels-last and so they will not be able to use the solution implemented in #20095, but we still want to offer a way of avoiding runtime-permutes
by supplying channels-last data. I suggest an analogue to the QuantizeInputs/QuantizeOutputs passes which would be PermuteInputs/PermuteOutputs`.

Similarly to the Quantize passes these would change the expected type of tensor to be run through the graph. Before the passes, inputs/outputs are (N, C, H, W), and after the pass
inputs/outputs are (N, H, W, C) with extra permutes inserted to ensure the graph does not change. These permutes will later fuse with the permutes inserted by the ToContiguousChannelsLastPass.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.