Skip to content

Conversation

@cccclai
Copy link
Contributor

@cccclai cccclai commented Aug 13, 2025

Summary:
There was an error when lowering amax around this line input_tensor = self.get_tensor(input_node, node) and the issue is that we're trying to permute the tensor inside node_visitors, op_node.meta[QCOM_AXIS_ORDER] is (0, 1), however, tensor.shape is (1, 980, 49).

Rollback Plan:

Differential Revision: D80187368

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 13, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit c775e98 with merge base 45e7810 (image):

NEW FAILURES - The following jobs have 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 Aug 13, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80187368

@github-actions
Copy link

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.

@cccclai
Copy link
Contributor Author

cccclai commented Aug 13, 2025

This PR fix the lowering issue, however, not quite sure a good unit test for it. Try to use the following code but looks like passing without this PR. Do you know what might trigger the error?

class ConvAMax2D(torch.nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size=3, dim=None, keepdim=False):
        super().__init__()
        self.conv = torch.nn.Conv2d(in_channels, out_channels, kernel_size, padding=kernel_size//2)  
        self.dim = dim
        self.keepdim = keepdim

    def forward(self, x):
        x = self.conv(x) 
        return torch.amax(x, dim=self.dim, keepdim=self.keepdim)

sample_input = torch.randn(2, 3, 64, 64) 
module = ConvAMax2D(in_channels=3, out_channels=16, kernel_size=3, dim=1, keepdim=False)
output = module(sample_input)

Edit:
Actually it does trigger the error, add it in the unit test

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Aug 13, 2025
Summary:

There was an error when lowering amax around this line `input_tensor = self.get_tensor(input_node, node)` and the issue is that we're trying to permute the tensor inside node_visitors, op_node.meta[QCOM_AXIS_ORDER] is (0, 1), however, tensor.shape is (1, 980, 49).

Rollback Plan:

Differential Revision: D80187368
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80187368

@cccclai
Copy link
Contributor Author

cccclai commented Aug 21, 2025

Can I get a review on this PR? @haowhsu-quic @shewu-quic @winskuo-quic @DannyYuyang-quic

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Aug 21, 2025
Summary:

There was an error when lowering amax around this line `input_tensor = self.get_tensor(input_node, node)` and the issue is that we're trying to permute the tensor inside node_visitors, op_node.meta[QCOM_AXIS_ORDER] is (0, 1), however, tensor.shape is (1, 980, 49).

Rollback Plan:

Differential Revision: D80187368
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80187368

Summary:

There was an error when lowering amax around this line `input_tensor = self.get_tensor(input_node, node)` and the issue is that we're trying to permute the tensor inside node_visitors, op_node.meta[QCOM_AXIS_ORDER] is (0, 1), however, tensor.shape is (1, 980, 49).

Rollback Plan:

Differential Revision: D80187368
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80187368

@cccclai cccclai merged commit 26c93df into pytorch:main Aug 25, 2025
103 of 106 checks passed
agrima1304 pushed a commit to agrima1304/executorch that referenced this pull request Aug 26, 2025
Summary:
There was an error when lowering amax around this line `input_tensor =
self.get_tensor(input_node, node)` and the issue is that we're trying to
permute the tensor inside node_visitors, op_node.meta[QCOM_AXIS_ORDER]
is (0, 1), however, tensor.shape is (1, 980, 49).

Rollback Plan:

Differential Revision: D80187368
kimishpatel pushed a commit that referenced this pull request Sep 2, 2025
Summary:
There was an error when lowering amax around this line `input_tensor =
self.get_tensor(input_node, node)` and the issue is that we're trying to
permute the tensor inside node_visitors, op_node.meta[QCOM_AXIS_ORDER]
is (0, 1), however, tensor.shape is (1, 980, 49).

Rollback Plan:

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants