pytorch / pytorch/executorch

Depthwise separable convolution computation by portable kernels expects wrong dim_order

Open
#22,520 0 comments 0 reactions 2 assignees View on GitHub

@JacobSzwejbka is already working on this.

Since Sep 10, 2026.

bug module: kernels module: nxp module: runtime
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🐛 Describe the bug

Running DSCNNKWS quantized executorch program in channel last using portable kernels produces the error below. The error indicates that a convolution (probably depthwise separable) expects a different dim order of the input tensor.
The error was discovered in a newly added NXP test for MLPerf Tiny Keyword Spotting in this PR:
https://github.com/pytorch/executorch/pull/22519
After investigating further, I believe the issue stems from legalize_portable_dim_order_passes, however I was unable to resolve it.
The error also looks quite similar to one of my previously reported issues:
https://github.com/pytorch/executorch/issues/20804

CRITICAL executorch.backends.nxp.tests.nsys_testing:nsys_testing.py:766 D 00:00:00.000010 executorch:operator_registry.cpp:116] Successfully registered all kernels from shared library: NOT_SUPPORTED
D 00:00:00.000052 executorch:operator_registry.cpp:116] Successfully registered all kernels from shared library: NOT_SUPPORTED
D 00:00:00.000162 executorch:operator_registry.cpp:116] Successfully registered all kernels from shared library: NOT_SUPPORTED
D 00:00:00.000736 executorch:method.cpp:864] Loading method: forward.
Loading file /home/nxg16998/code/executorch-integration/.outputs/test_mlperf_tiny_kws_mse_cpu_vs_npu[True]/dataset/test/example_Left_2_59_i00.bin
D 00:00:00.001189 executorch:method.cpp:1717] Executing method: forward.
E 00:00:00.003222 executorch:tensor_util_portable.cpp:64] Expected tensor to have default or channels last dim order, but got
E 00:00:00.003271 executorch:tensor_util_portable.cpp:68]     dim_order(0): 0
E 00:00:00.003276 executorch:tensor_util_portable.cpp:68]     dim_order(1): 2
E 00:00:00.003277 executorch:tensor_util_portable.cpp:68]     dim_order(2): 1
E 00:00:00.003278 executorch:tensor_util_portable.cpp:68]     dim_order(3): 3
E 00:00:00.003280 executorch:kernel_ops_util.cpp:384] Check failed (tensor_is_default_or_channels_last_dim_order(in)): 
E 00:00:00.003282 executorch:op_convolution.cpp:363] Check failed (check_convolution_args( in, weight, bias, stride, padding, dilation, transposed, output_padding, groups, out)): 
E 00:00:00.004056 executorch:method.cpp:1483] KernelCall failed at instruction 0:13 in operator aten::convolution.out: 0x12
E 00:00:00.004059 executorch:method.cpp:1493] arg 0 with type id 1
E 00:00:00.004060 executorch:method.cpp:1493] arg 1 with type id 1
E 00:00:00.004060 executorch:method.cpp:1493] arg 2 with type id 1
E 00:00:00.004061 executorch:method.cpp:1493] arg 3 with type id 8
E 00:00:00.004062 executorch:method.cpp:1493] arg 4 with type id 8
E 00:00:00.004062 executorch:method.cpp:1493] arg 5 with type id 8
E 00:00:00.004063 executorch:method.cpp:1493] arg 6 with type id 5
E 00:00:00.004063 executorch:method.cpp:1493] arg 7 with type id 8
E 00:00:00.004064 executorch:method.cpp:1493] arg 8 with type id 4
E 00:00:00.004064 executorch:method.cpp:1493] arg 9 with type id 1
E 00:00:00.004065 executorch:method.cpp:1493] arg 10 with type id 1
Execution of method forward failed with status 18...
Versions

Collecting environment information...
PyTorch version: 2.13.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 24.04.3 LTS (x86_64)
GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Clang version: 18.1.3 (1ubuntu1)
CMake version: version 3.31.10
Libc version: glibc-2.39

Python version: 3.12.3 (main, Jun 19 2026, 12:46:00) [GCC 13.3.0] (64-bit runtime)
Python platform: Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False
Caching allocator config: N/A

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: GenuineIntel
Model name: 13th Gen Intel(R) Core(TM) i5-1350P
CPU family: 6
Model: 186
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
Stepping: 2
BogoMIPS: 4377.61
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves avx_vnni vnmi umip waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize flush_l1d arch_capabilities
Virtualization: VT-x
Hypervisor vendor: Microsoft
Virtualization type: full
L1d cache: 384 KiB (8 instances)
L1i cache: 256 KiB (8 instances)
L2 cache: 10 MiB (8 instances)
L3 cache: 12 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Mitigation; Clear Register File
Vulnerability Retbleed: Mitigation; Enhanced IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

Versions of relevant libraries:
[pip3] executorch==1.5.0+9071414
[pip3] flake8==6.1.0
[pip3] flake8-breakpoint==1.1.0
[pip3] flake8-bugbear==24.4.26
[pip3] flake8-comprehensions==3.14.0
[pip3] flake8-plugin-utils==1.3.3
[pip3] flake8-pyi==23.5.0
[pip3] mypy==1.14.1
[pip3] mypy_extensions==1.1.0
[pip3] numpy==2.0.0
[pip3] optree==0.19.1
[pip3] pytorch_tokenizers==1.3.0
[pip3] torch==2.13.0+cpu
[pip3] torchao==0.18.0.dev20260729+cpu
[pip3] torchaudio==2.11.0+cpu
[pip3] torchdata==0.11.0+cpu
[pip3] torchsr==1.0.4
[pip3] torchtune==0.0.0
[pip3] torchvision==0.28.0+cpu
[conda] Could not collect

cc @larryliu0820 @manuelcandales @JakeStevens @JacobSzwejbka @lucylq @robert-kalmar @digantdesai @rascani

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.