Skip to content

Skip int8 model on GPU and merge from upstream - #6174

Merged
nihui merged 1 commit into
Tencent:masterfrom
c8s-wk:master
Jul 12, 2025
Merged

Skip int8 model on GPU and merge from upstream#6174
nihui merged 1 commit into
Tencent:masterfrom
c8s-wk:master

Conversation

@c8s-wk

@c8s-wk c8s-wk commented Jul 11, 2025

Copy link
Copy Markdown
Contributor
  • Added is_model_int8 to detect int8 models by filename or layer property.
  • Refactored benchmarking to use run_benchmark_if_supported, which loads model files, checks for int8, and skips GPU benchmarking for int8 models with a clear message.
  • Applies to both default and user-specified models(param).

@tencent-adm

tencent-adm commented Jul 11, 2025

Copy link
Copy Markdown
Member

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15657272 15657272 0 😘
armhf 6653616 6653616 0 😘
aarch64 9989032 9989032 0 😘

Comment thread benchmark/benchncnn.cpp Outdated
Comment thread benchmark/benchncnn.cpp Outdated
@c8s-wk
c8s-wk force-pushed the master branch 7 times, most recently from ec77068 to c4efac2 Compare July 12, 2025 07:15
@c8s-wk
c8s-wk requested a review from nihui July 12, 2025 08:24
Comment thread benchmark/benchncnn.cpp Outdated
@c8s-wk
c8s-wk force-pushed the master branch 2 times, most recently from dc93d2f to fc79978 Compare July 12, 2025 08:53
Comment thread benchmark/benchncnn.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

A concise summary of the purpose of the PR, followed by summarized bullets of changes

  • Introduces logic to detect int8 models and skip GPU benchmarking when an int8 model is used
  • Refactors benchmarking entry point to use run_benchmark_if_supported for both default and user-specified models
  • Applies consistent skip behavior and messaging across model sources
Comments suppressed due to low confidence (2)

benchmark/benchncnn.cpp:52

  • [nitpick] There are no tests verifying that GPU benchmarking is correctly skipped for int8 models; consider adding unit or integration tests for this branch.
    if (opt.use_vulkan_compute && strstr(comment, "int8") != NULL)

benchmark/benchncnn.cpp:54

  • [nitpick] The parameter fixed_path is ambiguous; renaming it to something like is_user_specified_model or use_custom_model would clarify its purpose.
        if (!fixed_path)

Comment thread benchmark/benchncnn.cpp
Comment thread benchmark/benchncnn.cpp
@nihui
nihui merged commit 4d8220c into Tencent:master Jul 12, 2025
6 checks passed
@nihui

nihui commented Jul 12, 2025

Copy link
Copy Markdown
Member

Thanks for your contribution !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants