mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-24 19:43:35 +00:00
treat zero point properly (#1686)
This commit is contained in:
parent
f25847bccd
commit
a8998b07b5
3 changed files with 7 additions and 7 deletions
|
|
@ -170,7 +170,7 @@ void
|
|||
size_t CountM,
|
||||
size_t CountK,
|
||||
int32_t* RowSumVector,
|
||||
uint16_t offb
|
||||
int16_t offb
|
||||
);
|
||||
|
||||
typedef MLAS_GEMM_U8U8_COPY_PACKA_ROUTINE* PMLAS_GEMM_U8U8_COPY_PACKA_ROUTINE;
|
||||
|
|
@ -184,7 +184,7 @@ void
|
|||
size_t CountN,
|
||||
size_t CountK,
|
||||
int32_t* ColumnSumVector,
|
||||
uint16_t offa
|
||||
int16_t offa
|
||||
);
|
||||
|
||||
typedef MLAS_GEMM_U8U8_COPY_PACKB_ROUTINE* PMLAS_GEMM_U8U8_COPY_PACKB_ROUTINE;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ MlasGemmU8U8CopyPackASse(
|
|||
size_t CountM,
|
||||
size_t CountK,
|
||||
int32_t* RowSumVector,
|
||||
uint16_t offb
|
||||
int16_t offb
|
||||
)
|
||||
/*++
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ MlasGemmU8U8CopyPackBSse(
|
|||
size_t CountN,
|
||||
size_t CountK,
|
||||
int32_t* ColumnSumVector,
|
||||
uint16_t offa
|
||||
int16_t offa
|
||||
)
|
||||
/*++
|
||||
|
||||
|
|
@ -558,7 +558,7 @@ MlasQgemm(
|
|||
CountN = N - n;
|
||||
}
|
||||
|
||||
MlasPlatform.GemmU8U8CopyPackBRoutine(PanelB, B + n + k * ldb, ldb, CountN, CountK, ColumnSumVector, offa);
|
||||
MlasPlatform.GemmU8U8CopyPackBRoutine(PanelB, B + n + k * ldb, ldb, CountN, CountK, ColumnSumVector, -int16_t(offa));
|
||||
|
||||
size_t CountM;
|
||||
|
||||
|
|
@ -570,7 +570,7 @@ MlasQgemm(
|
|||
CountM = M - m;
|
||||
}
|
||||
|
||||
MlasPlatform.GemmU8U8CopyPackARoutine(PanelA, A + k + m * lda, lda, CountM, CountK, RowSumVector, offb);
|
||||
MlasPlatform.GemmU8U8CopyPackARoutine(PanelA, A + k + m * lda, lda, CountM, CountK, RowSumVector, -int16_t(offb));
|
||||
|
||||
int16_t* pa = PanelA;
|
||||
int32_t* c = C + n + m * ldc;
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ private:
|
|||
int32_t sum = 0;
|
||||
|
||||
for (size_t k = 0; k < K; k++) {
|
||||
sum += ((*b + offb) * (*a + offa));
|
||||
sum += ((int32_t(*b) - offb) * (int32_t(*a) - offa));
|
||||
b += ldb;
|
||||
a += 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue