Skip to content

[quantization] Dispatch key error message is confusing to users #28518

@jamesr66a

Description

@jamesr66a

For example: #28483

User encounters the following inscrutable error message:

RuntimeError: Didn't find kernel to dispatch to for operator 'quantized::conv2d'. Tried to look up kernel for dispatch key 'CPUTensorId'. Registered dispatch 
keys are: [QuantizedCPUTensorId] (lookup_ at /opt/conda/conda-bld/pytorch_1570910687650/work/aten/src/ATen/core/dispatch/DispatchTable.h:249)

We should figure out a way to print a more friendly error message, such as:

Tried to run quantized::conv2d, but the input was not quantized! Please ensure you have QuantStub during model conversion, or you explicitly call  one of quantize_per_tensor, quantize_per_channel

cc @jerryzh168 @jianyuh @dzhulgakov @raghuramank100

Metadata

Metadata

Assignees

Labels

oncall: quantizationQuantization support in PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions