Skip to content

Commit

Permalink
Fix a bug in WASM's GEMM (#20023)
Browse files Browse the repository at this point in the history
### Description
Fix a bug in WASM's GEMM. The bug was found when running
"ConvAddActivationFusionTests.ConvGemmDirect" unit test in a wasm build
with address sanitizer enabled. When CountK=25, CountN=1, lda=25, ldc=1,
the function I am modifying triggered a read out of bound error.

The bug fix was provided by @fs-eire.
  • Loading branch information
snnn authored Mar 23, 2024
1 parent 71551da commit 3b4b99b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,9 @@ Return Value:
if (k > 0) {

Row0AElements0 = a[0];
Row0AElements1 = a[1];

if (ProcessTwoRows) {
Row1AElements0 = a[lda];
Row1AElements1 = a[lda + 1];
}

BElements0 = MlasLoadFloat32x4(B + 0);
Expand Down

0 comments on commit 3b4b99b

Please sign in to comment.