Skip to content

Conv3d with circular padding on portable fails at runtime #11704

Closed

Description

@GregoryComer

🐛 Describe the bug

The following repro produces an artifact that can't run at runtime. I haven't looked deeply yet to figure out where the issue is, so this needs more triage. Might be in the pytorch decomp, might be in the kernels.

Repro:

import torch

from executorch.exir import to_edge_transform_and_lower, EdgeCompileConfig, to_edge
from executorch.extension.pybindings.portable_lib import _load_for_executorch_from_buffer

class Model(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = torch.nn.Conv3d(5, 5, 3, padding_mode="circular")
        
    def forward(self, x):
        return self.conv(x)

model = Model()
inputs = (
    torch.randn(1, 5, 6, 6, 6),
)

eager_outputs = model(*inputs)
print(f"Eager: {eager_outputs.shape} {eager_outputs}")

ep = torch.export.export(model.eval(), inputs)
print(ep)

lowered = to_edge_transform_and_lower(
    ep,
    compile_config=EdgeCompileConfig(_check_ir_validity=False)
).to_executorch()

print(lowered.exported_program())

et_model = _load_for_executorch_from_buffer(lowered.buffer)
et_outputs = et_model([*inputs])[0]

et_outputs - eager_outputs

Output:

[kernel_ops_util.cpp:345] Check failed (in.dim() == 3 || in.dim() == 4): Expect input tensor to be 3-D or 4-D, but got, 5.
[op_convolution.cpp:377] Check failed (check_convolution_args( in, weight, bias, stride, padding, dilation, transposed, output_padding, groups, out)): 
[method.cpp:1322] KernelCall failed at instruction 0:5 in operator aten::convolution.out: 0x12
[method.cpp:1328] arg 0 with type id 1
[method.cpp:1328] arg 1 with type id 1
[method.cpp:1328] arg 2 with type id 1
[method.cpp:1328] arg 3 with type id 8
[method.cpp:1328] arg 4 with type id 8
[method.cpp:1328] arg 5 with type id 8
[method.cpp:1328] arg 6 with type id 5
[method.cpp:1328] arg 7 with type id 8
[method.cpp:1328] arg 8 with type id 4
[method.cpp:1328] arg 9 with type id 1
[method.cpp:1328] arg 10 with type id 1

Versions

Nightly

cc @JacobSzwejbka @angelayi @larryliu0820 @manuelcandales

Activity

  1. added theissue type on Jun 15, 2025
  2. added
    module: exir
    module: kernels
    backend tester
    on Jun 15, 2025
  3. arkadip-maitra commented on Jun 3, 2026

    @arkadip-maitra
    Contributor

    portable aten::convolution.out only supported 1D/2D inputs so exported rank 5 Conv3d models failed, added pr fixing this

  4. added a commit that references this issue on Jul 8, 2026
    636daf1
  5. moved this from To triage to Done in ExecuTorch Coreon Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend testermodule: exirmodule: kernels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions