From 1e158ea5915278dd0a94e15afc35dc9b84cb635c Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 21 Mar 2024 20:20:27 -0700 Subject: [PATCH 1/2] Fix a bug in WASM's GEMM --- onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp b/onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp index 955b7c5deee9a..700d103bcb535 100644 --- a/onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp +++ b/onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp @@ -171,11 +171,11 @@ Return Value: if (k > 0) { Row0AElements0 = a[0]; - Row0AElements1 = a[1]; + Row0AElements1 = a[0]; if (ProcessTwoRows) { Row1AElements0 = a[lda]; - Row1AElements1 = a[lda + 1]; + Row1AElements1 = a[lda]; } BElements0 = MlasLoadFloat32x4(B + 0); From 2dca0c977769a972fada0e817da031a17dd025a7 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 22 Mar 2024 16:56:54 -0700 Subject: [PATCH 2/2] Update SgemmKernelWasmSimd.cpp --- onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp b/onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp index 700d103bcb535..43a12b37e4ffa 100644 --- a/onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp +++ b/onnxruntime/core/mlas/lib/wasm_simd/SgemmKernelWasmSimd.cpp @@ -171,11 +171,9 @@ Return Value: if (k > 0) { Row0AElements0 = a[0]; - Row0AElements1 = a[0]; if (ProcessTwoRows) { Row1AElements0 = a[lda]; - Row1AElements1 = a[lda]; } BElements0 = MlasLoadFloat32x4(B + 0);