pytorch / executorch

On-device AI across mobile, embedded and edge for PyTorch
https://pytorch.org/executorch/
Other
2.22k stars 368 forks source link

The error in the XNNPACK quantize script in aot_compiler.py #6886

Open LuckyHeart opened 1 week ago

LuckyHeart commented 1 week ago

🐛 Describe the bug

I think maybe there is an error in the aot_compiler.py.

After quantization, we need leverage the XNNPACK delegate to lower the quantized exported model graph.

However, the ep is not a quantized exported model graph.

edge = to_edge_transform_and_lower(
        ep,
        partitioner=[XnnpackPartitioner()],
        compile_config=EdgeCompileConfig(
            _check_ir_validity=False if args.quantize else True,
            _skip_dim_order=True,  # TODO(T182187531): enable dim order in xnnpack
        ),
    )

Versions

none