26 Commits

Author SHA1 Message Date
Stern bbaca40c35 x86: reduce Col2im memory access for non-overlapping deconvolution (#7015)
* Reduce memory access in x86 deconvolution Col2im

The SGEMM path fills the output with bias, then reads and updates each
output value. When kernel tiles do not overlap, each value has one source.
Write the source plus bias once, and fill only the output padding.

Use this path for rectangular kernels with unit dilation and stride equal
to the kernel size. Support packs of 1, 4, and 8. Split input rows between
workers when there are fewer output channel groups than threads. Each
worker writes separate output rows. Keep the existing path for other
cases. Add 32 test cases to test_deconvolution.

Test Plan
---------
These commands passed in the local benchmark workspace:

```bash
ctest --test-dir .tools/ncnn-col2im-build -R '^test_deconvolution$' --output-on-failure
.venv-esp/bin/python results/oss/col2im_transfer_20260920/generalization/test_ncnn.py --parallel
.venv-esp/bin/python results/oss/col2im_transfer_20260920/generalization/sanitize_ncnn.py
```

The complete forward test gave equal output bits for 236 cases and
1,433,578 values. The extracted loops passed ASan and UBSan for 300 cases.
The sanitizer test uses a small Mat substitute, not a full sanitizer build.
The local probe scripts are outside this repository.

The final format check and git diff --check passed. The format changes do
not change the tested operations.

This change was prepared with help from an AI assistant.
2026-10-08 19:44:27 +08:00
nihui 41f031e045 reduce redundant tests that do not contribute to coverage (#7042)
* adjust tests
* opt shader coverage op
* update gpu_coverage.cpp atomicor coalesce
2026-10-05 08:57:20 +08:00
nihui 9f9d4ec815 reduce gpu test cases (#7017) 2026-10-01 23:33:05 +08:00
nihui 5ea98309e3 layer param hardening (#7003)
* harden layer parameter validation

Original patches and author identities:
https://github.com/Tencent/ncnn/pull/6912 (beilzx)
https://github.com/Tencent/ncnn/pull/6919 (FluxMind-O)
https://github.com/Tencent/ncnn/pull/6928 (lxcxjxhx)
https://github.com/Tencent/ncnn/pull/6948 (ktz03)
https://github.com/Tencent/ncnn/pull/6950 (ktz03)
https://github.com/Tencent/ncnn/pull/6971 (LI)
https://github.com/Tencent/ncnn/pull/6974 (LI)
https://github.com/Tencent/ncnn/pull/6977 (LI)

Co-authored-by: beilzx <2069360659@qq.com>
Co-authored-by: FluxMind-O <3283918317@qq.com>
Co-authored-by: lxcxjxhx <lxcxjxhx@users.noreply.github.com>
Co-authored-by: ktz03 <2484593937@qq.com>
Co-authored-by: LI <2484593937@qq.com>
2026-09-15 19:18:46 +08:00
nihui f6e1c0cd49 x86 deconvolution packed unified elempack (#6568) 2026-02-28 22:30:58 +08:00
nihui 6499fc0348 vulkan bf16 infrastructure (#6469)
* skip gpu bf16 winograd
* update doc
2026-01-04 19:34:50 +08:00
nihui b5bc05e2e8 drop vulkan shader pack8 (#6270) 2025-08-22 11:05:59 +08:00
nihui fe509e9bc1 flexible coopmat mnk and unified elempack for vulkan deconvolution gemm (#6199) 2025-07-23 21:58:32 +08:00
nihui 171b9d1bba use spdx license header, copyright Tencent (#6152) 2025-07-08 11:01:29 +08:00
nihui 24a3b99f1f drop layer support_image_storage and option use_image_storage (#6126)
* fix pyncnn build
2025-06-16 11:23:41 +08:00
nihui 556b79ce4d create layer decoupled (#5258)
* create layer decoupled
* no more virtual public
* allow build test with shared library
* decouple cpu vulkan
* drop old scripts
2024-01-05 14:08:15 +08:00
nihui 4494aadd74 deconvolution dynamic weight (#5119) 2023-10-31 17:37:24 +08:00
nihui 85991e2e0e test custom option, update ci (#4609)
* early return for cpu test

* make nvidia driver happy

* fix gemm x86 threading
2023-04-10 15:03:57 +08:00
nihui 131f3d1323 x86 avx512 optimization for convolution winograd pack16to1 and deconvolution family, increase simpleomp argv count (#3694)
* convolution winograd pack16to1

* x86 deconvolution and deconvolutiondepthwise

* simpleomp allow 32 arguments

* drop shadow variable workaround

* less winograd test error
2022-04-12 15:11:56 +08:00
nihui 2880eff264 deconv1d deconv3d (#3584)
* fix sigmoid returns nan with very large input
2022-03-01 21:50:17 +08:00
nihui 11cffce114 armv8.2 infrastructure (#1856)
* runtime cpu dispatch

* force thread one

* disable openmp for coverage

* simplify test layer

* print NCNN_TARGET_ARCH

* less ci build variants

* weight fp16 storage option

* test convdw int8

* apple a12 a13

* ncnn_add_layer ncnn_add_shader cmake macro
2020-07-19 19:29:52 +08:00
nihui 109e079c51 test deconvolution with output shape and padding 2020-07-08 22:03:43 +08:00
nihui 3ef995ed1e format code style and setup restyled.io (#1840) 2020-06-13 22:17:51 +08:00
nihuini b2d9325c0d test activation fusion 2020-04-23 14:52:22 +08:00
nihuini 956ab49d02 fix conv1x1s1 pack4to1 bf16s 2020-04-13 12:39:15 +08:00
nihuini 36f6942fa0 testing time is too long ... 2020-04-13 11:24:31 +08:00
nihui 979dd5fd11 test does not need to provide data type options 2020-04-12 19:28:04 +08:00
nihui 839c4c4e34 smaller test size 2020-03-01 20:19:11 +08:00
nihui 0f7e7bca02 shader shape specialization constant and basic local group size partition (#1523)
* use Mat class for Shape description

* shape specialization constant in compute shader

* wip

* wip

* test forward_inplace, add binaryop unaryop sigmoid test

* fix arm unaryop test

* fix arm binaryop test

* make shape hint optional, cast int8 to fp32, add cast test

* wip

* follow the good and old local size setting for conv1x1

* the optimal local size rewrite

* fix build on msvc

* add permute shader for all packing layout, add permute test

* concat and slice patial shape constant, slice test

* fix slice test

* interp test

* add lrn test, test packing layout implicitly

* add eltwise test

* add normalize test

* add instancenorm test

* reorg shape constant

* simple local group size partition

* add shape constant param
2020-02-17 15:45:29 +08:00
nihui 6f2ef1932d int8 code refactoring wip, add int8 test 2020-01-05 00:08:11 +08:00
nihui 038666e049 the initial auto test (#1464)
* cpu test

* wip

* ci run test

* travis ci for arm64

* arm64 ctest

* copy vulkan loader

* wip

* run

* Update ccpp.yml

* gpu test

* swiftshader

* cache macos swiftshader

* try MoltenVK

* try vulkaninfo

* give swiftshader another try

* disable failed macos gpu test

* more conv test, fix conv3x3s1 gpu test fail

* fix deconvolution test

* dilation test

* cmake option to build tests

* ncnn_add_layer_test macro

* host barrier before upload and after download, handle packing layout option

* test packing layout

* wip

* wip

* merge deconvolution packing and non-packing code

* merge convolution packing and non-packing code

* pass top_blob_count param

* fix build

* take care of non-coherent mappable memory
2019-12-31 21:12:24 +08:00