Skip to content

Conversation

nihui
Copy link
Member

@nihui nihui commented Jul 24, 2025

No description provided.

@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes tensor dimension handling by changing key variables from int to size_t to properly support large tensors. This is important for avoiding integer overflow when dealing with large matrices and tensors where dimensions can exceed the range of 32-bit integers.

Key changes include:

  • Converting stride variables from int to size_t in softmax implementations
  • Updating tensor step calculations to use size_t for memory offsets
  • Changing matrix dimension variables in GEMM operations to size_t

Reviewed Changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/layer/x86/softmax_x86.cpp Updates stride parameters to size_t in softmax functions
src/layer/x86/gemm_x86.cpp Changes tensor step calculations to size_t for GEMM operations
src/layer/x86/gemm_int8.h Updates matrix step variables to size_t in int8 GEMM functions
src/layer/x86/convolution_packed_int8.h Changes tensor step calculations to size_t in convolution
src/layer/x86/convolution_packed.h Updates tensor step variables to size_t
src/layer/x86/convolution_im2col_gemm_int8.h Changes offset calculations to size_t
src/layer/x86/convolution_3x3_winograd_int8.h Updates tensor step variables to size_t
src/layer/x86/convolution_3x3_winograd.h Changes tensor step calculations to size_t
src/layer/slice.cpp Updates size calculations to size_t
src/layer/riscv/softmax_riscv.cpp Changes stride parameters to size_t
src/layer/riscv/gemm_riscv.cpp Updates tensor step variables to size_t
src/layer/glu.cpp Changes offset calculation to size_t
src/layer/gemm.cpp Updates tensor step calculations to size_t
src/layer/arm/* Multiple ARM-specific files with similar size_t conversions

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.70%. Comparing base (fe509e9) to head (2a9cf5c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6201      +/-   ##
==========================================
- Coverage   96.17%   95.70%   -0.47%     
==========================================
  Files         835      835              
  Lines      260827   265247    +4420     
==========================================
+ Hits       250843   253860    +3017     
- Misses       9984    11387    +1403     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

github-actions bot commented Jul 24, 2025

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15639200 15643128 +3928 ⚠️
armhf 6648076 6648220 +144 ⚠️
aarch64 9987568 9986896 -672 😘

@nihui nihui merged commit 8c5e23b into Tencent:master Jul 24, 2025
103 of 109 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants