Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6582 +/- ##
==========================================
+ Coverage 93.19% 94.00% +0.80%
==========================================
Files 832 684 -148
Lines 267728 219179 -48549
==========================================
- Hits 249520 206046 -43474
+ Misses 18208 13133 -5075 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7 gelu (erf exact or tanh fast selected by activation_params[0]), 8 silu, 9 elu, 10 selu, following the existing standalone gelu/swish/elu/selu layers. extend fused_activation.h, the arm/x86/riscv/mips/loongarch activation dispatch (arm and x86 reuse the mathfun and *_fp32 helpers already in tree), the vulkan activation shader and the per-layer load_param validation. based on the wip work of Tencent#6582.
bump the random activation range and the deterministic activation sweeps to 0-10 for convolution, convolutiondepthwise, deconvolution, deconvolutiondepthwise, deformableconv2d, innerproduct and requantize, and cover the new types in the load_param validation tests.
add hardswish, gelu (exact and tanh), silu, elu and selu fusion to the existing convolution family passes, and add passes for convolution3d, convolutiondepthwise3d, deconvolution1d/3d, deconvolutiondepthwise1d/3d and deformableconv2d. the innerproduct pass now covers the same activation set. vulkan keeps the tanh gelu approximation.
one test per layer type running all ten activations through pnnx and comparing with ncnn inference, plus innerproduct and deformableconv2d.
hardswish/hardsigmoid: use x*clamp(alpha*x+beta,0,1) in the scalar reference, every per-arch scalar tail and the riscv vector bodies, so alpha<=0 no longer diverges from the vectorized kernels (test_deconvolutiondepthwise_1 failed deterministically before); add alpha<0 regression cases to test_hardswish/test_hardsigmoid. vulkan: fused activation type 7 honors the fast_gelu flag again (erfc branch via the Abramowitz-Stegun 7.1.26 erf approximation, max deviation 4.8e-7 vs the cpu reference) and clamps the tanh argument to +-10 like gelu.comp. pnnx: replace the copy-pasted relu match() bodies in the deformableconv2d mask variants, reviving 5 dead fusions and relaxing 4 over-restrictive ones; strip the stray CR bytes that made the hardswish pattern lines look malformed.
Contributor
Author
This branch has not been deployed
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.
activate function fused