opt innerproduct and convolutiondepthwise x86 int8 sse4.1#6687
Open
Edwardssss wants to merge 2 commits intoTencent:masterfrom
Open
opt innerproduct and convolutiondepthwise x86 int8 sse4.1#6687Edwardssss wants to merge 2 commits intoTencent:masterfrom
Edwardssss wants to merge 2 commits intoTencent:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
It's TODO in
src/layer/x86/convolutiondepthwise_x86.cppandsrc/layer/x86/innerproduct_x86.cppAdd SSE4.1
_mm_cvtepi8_epi16(pmovsxbwinstruction) forint8sign extension in x86, replacing the legacy SSE2 pseudo sign-extension sequence.This avoids the overhead of unpacking and shifting masks, significantly unlocking the performance of int8 inference on x86 architectures, particularly for models with heavy fully connected or depthwise separable convolution layers. Added proper fallback and
-msse4.1conditional#ifndef __SSE4_1__guard loops to preserve backward compatibility.Benchmark
./benchmark/benchncnn 8 4 0)master(Clean build) vs PR Branch:opt-innerproduct-x86-int8-sse41I noticed that there seems to be no benchmark testing for devices very similar to mine in
benchmark/README.md. If needed, I can submit a new PR later to improve it. :)