Skip to content

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

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

Open
yurivict opened this issue Dec 23, 2024 · 3 comments
Labels
build build issues; typically submitted using template contributions welcome external contributions welcome

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?

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Jan 23, 2025
@snnn snnn added contributions welcome external contributions welcome and removed stale issues that have not been addressed in a while; categorized by a bot labels Jan 23, 2025
@snnn
Copy link
Member

snnn commented Apr 10, 2025

@liqunfu / @fajin-corp , would you please help?

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 contributions welcome external contributions welcome
Projects
None yet
Development

No branches or pull requests

2 participants