Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] error: array index 7 is past the end of the array (that has type '__m256[4]') #23180

Open
yurivict opened this issue Dec 23, 2024 · 1 comment
Labels
build build issues; typically submitted using template

Comments

@yurivict
Copy link
Contributor

Describe the issue

Build fails with version 1.20.1 while it succeeded with version 1.18.2:

In file included from /usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx512.cpp:25:
In file included from /usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx512_int8_blklen16.h:9:
In file included from /usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx512_int8_blklen32.h:8:
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:954:49: error: array index 4 is past the end of the array (that has type '__m256[4]') [-Werror,-Warray-bounds]
  954 |                 __m128 acc_1 = FoldAccumulators(acc[4], acc[5], acc[6], acc[7]);
      |                                                 ^   ~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:822:13: note: array 'acc' declared here
  822 |             __m256 acc[NCols4];
      |             ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:954:57: error: array index 5 is past the end of the array (that has type '__m256[4]') [-Werror,-Warray-bounds]
  954 |                 __m128 acc_1 = FoldAccumulators(acc[4], acc[5], acc[6], acc[7]);
      |                                                         ^   ~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:822:13: note: array 'acc' declared here
  822 |             __m256 acc[NCols4];
      |             ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:954:65: error: array index 6 is past the end of the array (that has type '__m256[4]') [-Werror,-Warray-bounds]
  954 |                 __m128 acc_1 = FoldAccumulators(acc[4], acc[5], acc[6], acc[7]);
      |                                                                 ^   ~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:822:13: note: array 'acc' declared here
  822 |             __m256 acc[NCols4];
      |             ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:954:73: error: array index 7 is past the end of the array (that has type '__m256[4]') [-Werror,-Warray-bounds]
  954 |                 __m128 acc_1 = FoldAccumulators(acc[4], acc[5], acc[6], acc[7]);
      |                                                                         ^   ~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:822:13: note: array 'acc' declared here
  822 |             __m256 acc[NCols4];
      |             ^
4 errors generated.

Urgency

No response

Target platform

FreeBSD 14.2

Build script

cmake && gmake

Error / output

Build fails:

In file included from /usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx512.cpp:25:
In file included from /usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx512_int8_blklen16.h:9:
In file included from /usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx512_int8_blklen32.h:8:
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:954:49: error: array index 4 is past the end of the array (that has type '__m256[4]') [-Werror,-Warray-bounds]
  954 |                 __m128 acc_1 = FoldAccumulators(acc[4], acc[5], acc[6], acc[7]);
      |                                                 ^   ~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:822:13: note: array 'acc' declared here
  822 |             __m256 acc[NCols4];
      |             ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:954:57: error: array index 5 is past the end of the array (that has type '__m256[4]') [-Werror,-Warray-bounds]
  954 |                 __m128 acc_1 = FoldAccumulators(acc[4], acc[5], acc[6], acc[7]);
      |                                                         ^   ~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:822:13: note: array 'acc' declared here
  822 |             __m256 acc[NCols4];
      |             ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:954:65: error: array index 6 is past the end of the array (that has type '__m256[4]') [-Werror,-Warray-bounds]
  954 |                 __m128 acc_1 = FoldAccumulators(acc[4], acc[5], acc[6], acc[7]);
      |                                                                 ^   ~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:822:13: note: array 'acc' declared here
  822 |             __m256 acc[NCols4];
      |             ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:954:73: error: array index 7 is past the end of the array (that has type '__m256[4]') [-Werror,-Warray-bounds]
  954 |                 __m128 acc_1 = FoldAccumulators(acc[4], acc[5], acc[6], acc[7]);
      |                                                                         ^   ~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h:822:13: note: array 'acc' declared here
  822 |             __m256 acc[NCols4];
      |             ^
4 errors generated.

Visual Studio Version

No response

GCC / Compiler Version

clang-18

@yurivict yurivict added the build build issues; typically submitted using template label Dec 23, 2024
@snnn
Copy link
Member

snnn commented Dec 23, 2024

Yeah, I can confirm I hit the same error on Linux too. It's not a bug though. I think it is a false positive warning. @liqunfu, would you mind suppressing the warning or rewriting the code in a different way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

No branches or pull requests

2 participants