microsoft / microsoft/onnxruntime
[Performance] Replace MatMul with FullyConnected
@adrianlizarraga is already working on this.
Since May 4, 2024.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 184
Description
### Describe the issue
QNN's implementation of MatMul is much slower than the equivalent FullyConnected implementation.
The QNN delegate should insert reshapes around 3D/4D MatMul to squish the input to 2D, then replace all instances of MatMul with FullyConnected layers.
### To reproduce
See attached models.
### Urgency
_No response_
### Platform
Linux
### OS Version
Ubuntu 22.04
### ONNX Runtime Installation
Built from Source
### ONNX Runtime Version or Commit ID
Latest
### ONNX Runtime API
Python
### Architecture
ARM64
### Execution Provider
Other / Unknown
### Execution Provider Library Version
QNN 2.20
### Model File
[MatMul_Repros.zip](https://github.com/microsoft/onnxruntime/files/15170393/MatMul_Repros.zip)
### Is this a quantized model?
No
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.