ONNXToDeepSparse matmul integer conversion patches for whipser support #1616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quantization experiments for the whipser model resulted with a few
MatMulInteger
ops that did not have their weights properly folded. This is primarily due to the non-parameterized matmul matching improperly not skipping over parameterized matmuls (see fixes in src/sparseml/exporters/transforms/matmul_to_matmulinteger_cast_mul.py).The longer fixes in the other two files update pattern matching to convert parameterized matmuls without bias adds, this were lifted from my updates in #1559 that are still pending review. We can merge these first as they are tangential to that PR as well
test_plan:
![Screenshot 2023-06-08 at 5 20 05 PM](https://private-user-images.githubusercontent.com/11316925/244509030-32022388-94c3-40f0-8fd5-db406d76b1ce.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA4MzkyNTIsIm5iZiI6MTcyMDgzODk1MiwicGF0aCI6Ii8xMTMxNjkyNS8yNDQ1MDkwMzAtMzIwMjIzODgtOTRjMy00MGYwLThmZDUtZGI0MDZkNzZiMWNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEzVDAyNDkxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMyYzY0ZmY0ZjI2MDRkMGU0NjMxMDgyNjA2NWQ5MmQ3YTYwMzUyNzZiOTNiZWIyNDYwMTdhZDE3MzYzNzAxMmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.SbXseFDzR_Et__CkL0DBLZsvu9gJrEHowMgrAkStH20)
Improper conversion before:
Fixed conversion after:
![Screenshot 2023-06-08 at 5 20 33 PM](https://private-user-images.githubusercontent.com/11316925/244509177-cc051c85-c538-481b-ad03-9f8595befa68.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA4MzkyNTIsIm5iZiI6MTcyMDgzODk1MiwicGF0aCI6Ii8xMTMxNjkyNS8yNDQ1MDkxNzctY2MwNTFjODUtYzUzOC00ODFiLWFkMDMtOWY4NTk1YmVmYTY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEzVDAyNDkxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmYzAxYmMwZDQ1ODEwODRjZTExYmRmM2FmY2U2ZDMwYmIwMGIxNWU5M2M0NjhmOTJjNDYwZDJjMWJlMzM5ODgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1okS7R1UtAqWfiy77s9qRL-tdNu_6QSHHYN5iUgD6tU)