Skip to content

[ARM] aot_arm_compiler.py does not quantize Conv2d for cortex-m55+int8 target #17902

@jonasdaugalas

Description

@jonasdaugalas

🐛 Describe the bug

Model:

import torch

ModelUnderTest = torch.nn.Conv2d(in_channels=2, out_channels=4, kernel_size=3)
ModelInputs = (torch.randn(1, 2, 8, 8),)

Log:

$ /home/wsluser/proj/nn-deploy-kit/.venv/bin/python -m examples.arm.aot_arm_compiler \
--model_name /home/wsluser/proj/nn-deploy-kit/repro/aot_compiler_cortex_m_conv/conv2d.py \
--target cortex-m55+int8 \
--output /home/wsluser/proj/nn-deploy-kit/repro/aot_compiler_cortex_m_conv/out_conv2d__cortex-m__Delegate=N__Quantize=Y/model.pte \
--intermediates /home/wsluser/proj/nn-deploy-kit/repro/aot_compiler_cortex_m_conv/out_conv2d__cortex-m__Delegate=N__Quantize=Y/intermediates \
--quantize
[WARNING 2026-03-05 15:40:35,398 aot_arm_compiler.py:812] Converting input tensor with shape [1, 2, 8, 8] to channels_last
/usr/lib/python3.12/copyreg.py:99: FutureWarning: `isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
  return cls.__new__(cls, *args)
/usr/lib/python3.12/copyreg.py:99: FutureWarning: `isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
  return cls.__new__(cls, *args)
/usr/lib/python3.12/copyreg.py:99: FutureWarning: `isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
  return cls.__new__(cls, *args)
/home/wsluser/proj/nn-deploy-kit/.venv/lib/python3.12/site-packages/executorch/exir/tensor.py:83: FutureWarning: guard_size_oblivious will be removed. Consider using explicit unbacked handling     potentially utilizing guard_or_false, guard_or_true, or statically_known_true
  return guard_size_oblivious(self.stride < other.stride)
PTE file saved as /home/wsluser/proj/nn-deploy-kit/repro/aot_compiler_cortex_m_conv/out_conv2d__cortex-m__Delegate=N__Quantize=Y/model.pte

Visualization model-explorer --extensions=pte_adapter_model_explorer:

Image

Observed behavior: the convolution op is floating-point.
Expected behavior: the convolution to be int8x8 quantized.

Versions

Collecting environment information...
PyTorch version: 2.11.0.dev20260215+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: Could not collect
CMake version: version 3.31.10
Libc version: glibc-2.39

Python version: 3.12.3 (main, Jan 22 2026, 20:57:42) [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: True
Caching allocator config: N/A

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 39 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
CPU family: 6
Model: 165
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
Stepping: 5
BogoMIPS: 5808.01
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 arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow ept vpid ept_ad fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves vnmi md_clear flush_l1d arch_capabilities
Virtualization: VT-x
Hypervisor vendor: Microsoft
Virtualization type: full
L1d cache: 256 KiB (8 instances)
L1i cache: 256 KiB (8 instances)
L2 cache: 2 MiB (8 instances)
L3 cache: 16 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Unknown: Dependent on hypervisor status
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Reg file data sampling: Not affected
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 SW loop, KVM SW loop
Vulnerability Srbds: Unknown: Dependent on hypervisor status
Vulnerability Tsx async abort: Not affected

Versions of relevant libraries:
[pip3] executorch==1.2.0a0+1619308
[pip3] numpy==2.4.2
[pip3] pytorch_tokenizers==1.1.0
[pip3] torch==2.11.0.dev20260215+cpu
[pip3] torchao==0.16.0+git026b76d1
[pip3] torchaudio==2.11.0.dev20260215+cpu
[pip3] torchdata==0.11.0
[pip3] torchsr==1.0.4
[pip3] torchtune==0.0.0
[pip3] torchvision==0.26.0.dev20260215+cpu
[conda] Could not collect

cc @digantdesai @SS-JIA @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @psiddh @AdrianLundell

Metadata

Metadata

Assignees

Labels

module: armIssues related to arm backendmodule: microcontrollersFor embedded MCUs like Cortex-M, or RTOS like Zephyr, does not track NPU backend like Arm Ethos.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions