forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding prepacking to QLinearMatMul (microsoft#6980)
Reuse the same prepacking logic in mat mul integer, to enable prepacking weight for QLinearMatMul. Currently only prepacking 2D matrix weights
- Loading branch information
Showing
7 changed files
with
252 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
onnxruntime/core/providers/cpu/math/quantize_linear_matmul.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
|
||
#include "matmul_integer_base.h" | ||
|
||
namespace onnxruntime { | ||
|
||
// Allow subclassing for test only | ||
class QLinearMatMul : public MatMulIntegerBase { | ||
public: | ||
QLinearMatMul(const OpKernelInfo& info) : MatMulIntegerBase(info) {} | ||
|
||
Status Compute(OpKernelContext* context) const override; | ||
|
||
/** | ||
* @brief Give each input a name, should be consistent with doc spec in | ||
* Operators.md | ||
*/ | ||
enum InputTensors : int { | ||
IN_A = 0, | ||
IN_A_SCALE = 1, | ||
IN_A_ZERO_POINT = 2, | ||
IN_B = 3, | ||
IN_B_SCALE = 4, | ||
IN_B_ZERO_POINT = 5, | ||
IN_Y_SCALE = 6, | ||
IN_Y_ZERO_POINT = 7 | ||
}; | ||
|
||
enum OutputTensors : int { | ||
OUT_Y = 0 | ||
}; | ||
|
||
protected: | ||
int GetBIdx() override { | ||
return IN_B; | ||
} | ||
}; | ||
|
||
} // namespace onnxruntime |
Oops, something went wrong.