Skip to content

Conversation

@pytorchbot
Copy link
Collaborator

  • Insert transposes for input/output iff the incoming/outgoing data is
    in channels first format.
  • For testing using tosa_reference_mode, transpose numpy arrays to and
    from correct data format since numpy doesn't have the concept of
    dim_order.
  • Remove checks for channels_first only input.
  • Remove check for not changing dim_order before to_tosa_memory_format
    pass since the behaviour of channel last tensors is non-predictable.
  • Add dim order testing of example networks and mv2
  • Add a section to the documentation about memory formats.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

Differential Revision: D82449155

Pull Request resolved: #14259

(cherry picked from commit 5348ea9)
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 18, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit cb348ae with merge base e0dda90 (image):

NEW FAILURE - The following job has failed:

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 Sep 18, 2025
@zingo zingo added the module: arm Issues related to arm backend label Sep 18, 2025
@zingo zingo added this to the 1.0.0 milestone Sep 18, 2025
@GregoryComer
Copy link
Member

Re-running jobs with infra failures. If it looks good, I'll merge shortly.

@GregoryComer
Copy link
Member

Samsung failure is unrelated infra. Discussed offline and it's being investigated. Merging.

@GregoryComer GregoryComer merged commit 017cab3 into release/1.0 Sep 18, 2025
656 of 661 checks passed
@GregoryComer GregoryComer deleted the cherry-pick-14259-by-pytorch_bot_bot_ branch September 18, 2025 19:11
"Input %d expected contiguous dim_order, but got non-contiguous dim_order",
i);
return Error::InvalidProgram;
}
Copy link
Contributor

@digantdesai digantdesai Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we (somehow) check if the assumptions in the blob about the input tensor dim_order are satisfied? It can silently do wrong compute is my concern.

def test_mv2_tosa_FP_channels_last():
input_tensor = model_inputs[0].to(memory_format=torch.channels_last)
pipeline = TosaPipelineFP[input_t](
mv2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it working correctly with NHWC input without mv2.to(channels_last) - it could be because you are assuming every weight is lowered to TOSA and during lowering you might be formatting. But if you can't lower some weight then it may fail, no?

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. module: arm Issues related to arm backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants