microsoft / microsoft/onnxruntime

Improve onnxruntime test coverage for Inference accuracy ( precisely gemm output numerical correctness checks)

Open
#16,786 4 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

Currently there isn't enough coverage for numerical correctness checks for inference use case. Inference accuracy checks to be added either to benchmark.py scripts or extend the unit tests to cover real model shapes. Today it's very hard to test and verify the numerical correctness for any new gemm kernel added to onnxruntime gemm libraries.

Details:
1. The onnxruntime_test_all test suite has the gemm output correctness checks, but the kernel sizes it covers are very primitive. For example, it is covering only up to 128 for K dimension, where as bert_base model has weights of `[768x768] `and `[3072x768]` dimension and bert_large has weights of `[1024x1024]` and `[4096x1024]` dimensions. Following are some of the shapes currently covered, but these sample shapes don't cover any real world models.
```
M:N:K->19:23:37
M:N:K->299:13:13
M:N:K->13:15:15
M:N:K->5:64:20
M:N:K->32:32:64
M:N:K->64:64:64
M:N:K->144:128:32
M:N:K->144:32:128
M:N:K->144:1000:32
```
2. The benchmark.py scripts test model inference with real models. The scripts focus only on the performance, but not the accuracy. Since the scripts use randomly generated input_ids, it's not possible to dump and verify the content as well.

### Describe scenario use case

Any inference use case

Contributor guide

Open the contributing guide

Research direction

Start by reading the onnxruntime_test_all GEMM correctness tests and the benchmark.py scripts, then compare their existing shapes and inference checks with the BERT base and large dimensions listed in the issue. The work is complete when inference numerical correctness is checked for representative real-model GEMM shapes, either through expanded unit tests or benchmark coverage, rather than performance alone.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
machine-learning, performance, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.