Skip to content

Commit

Permalink
fix heap overwrite issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yufenglee committed Mar 15, 2024
1 parent b853073 commit 7b44606
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/external/neural_speed.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if(USE_NEURAL_SPEED)
neural_speed
URL ${DEP_URL_neural_speed}
URL_HASH SHA1=${DEP_SHA1_neural_speed}
PATCH_COMMAND ${Patch_EXECUTABLE} -p1 < ${PROJECT_SOURCE_DIR}/patches/neural_speed/65b0f7a0d04f72f0d5a8d48af70f0366f2ab3939.patch
)
set(BTLA_USE_OPENMP OFF)
onnxruntime_fetchcontent_makeavailable(neural_speed)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/bestla/bestla_prologue_b.h b/bestla/bestla_prologue_b.h
index 28a7347..ce0880b 100644
--- a/bestla/bestla_prologue_b.h
+++ b/bestla/bestla_prologue_b.h
@@ -403,9 +403,8 @@ class WeightKBlockNInteger {
auto tmpscales = tmp;
auto tmpzeropoints = reinterpret_cast<int8_t*>(tmpscales + N * blks);
if (scales) {
- for (size_t i = 0; i < N * blks; i += 2) {
+ for (size_t i = 0; i < N * blks; i++) {
tmpscales[i] = scales[i] / 16;
- tmpscales[i + 1] = scales[i + 1] / 16;
}
}
if (zero_points) {

0 comments on commit 7b44606

Please sign in to comment.