microsoft / microsoft/onnxruntime

[Feature Request] QLinearMatmul : weight zero point must be a scalar, 1D tensor of size 1, or last to second dimension is 1

Open
#15,442 0 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the feature request

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException:
[ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running QLinearMatMul node. Name:'MatMul_266' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/math/quantize_linear_matmul.cc:37 virtual onnxruntime::common::Status onnxruntime::QLinearMatMul::Compute(onnxruntime::OpKernelContext*) const IsBQuantParamSupported(b_offset->Shape(), b ? b->Shape() : b_shape_) was false. QLinearMatmul : weight zero point must be a scalar, 1D tensor of size 1, or last to second dimension is 1

### Describe scenario use case

![image](https://user-images.githubusercontent.com/33031095/230847481-8d64086b-2eb7-4cc4-9017-a9ee8b549c2d.png)
![image](https://user-images.githubusercontent.com/33031095/230848170-71ef3688-dabc-4b77-a7d1-270b1944a51c.png)
![image](https://user-images.githubusercontent.com/33031095/230847601-e2e09cdc-604a-4d83-a07c-8af24feecdd2.png)

Thanks in advance!

Contributor guide

Open the contributing guide

Research direction

Start with onnxruntime/core/providers/cpu/math/quantize_linear_matmul.cc and inspect QLinearMatMul::Compute, especially the IsBQuantParamSupported check named in the error. Determine how weight zero-point shapes are validated, then confirm the requested scalar, one-element 1D, and supported last-to-second-dimension forms are accepted without regressing existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.