Skip to content

IndexError in Conv1dToConv2d pass due to incorrect argument count checkΒ #12161

@Chtho11y

Description

@Chtho11y

πŸ› Describe the bug

When converting a model to QNN backends using ExecuTorch, the conversion process fails at the Conv1dToConv2d pass with a tuple index out of range error:

Traceback (most recent call last):
  File "/root/anaconda3/envs/executorch/lib/python3.10/site-packages/torch/fx/passes/infra/pass_manager.py", line 276, in __call__
    res = fn(module)
  File "/root/anaconda3/envs/executorch/lib/python3.10/site-packages/torch/fx/passes/infra/pass_base.py", line 46, in __call__
    res = self.call(graph_module)
  File "/workspace/executorch/backends/qualcomm/_passes/convert_conv1d_to_conv2d.py", line 108, in call
    groups = node.args[6] if num_args > 5 else 1
IndexError: tuple index out of range

The error occurs at executorch/backends/qualcomm/_passes/convert_conv1d_to_conv2d.py:108 where the code checks for group argument:

groups = node.args[6] if num_args > 5 else 1

Obviously, the current condition num_args > 5 is incorrect for accessing node.args[6].
Modify it to num_args > 6 could fix the bug, just like line 122.

Versions

PyTorch version: 2.8.0.dev20250625+cpu
executorch==0.8.0a0+75d4b2e

cc @cccclai @winskuo-quic @shewu-quic @cbilgin

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: qnnIssues related to Qualcomm's QNN delegate and code under backends/qualcomm/partner: qualcommFor backend delegation, kernels, demo, etc. from the 3rd-party partner, QualcommtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions