Commit Graph

79 Commits

Author SHA1 Message Date
nihui 171b9d1bba use spdx license header, copyright Tencent (#6152) 2025-07-08 11:01:29 +08:00
nihui 6396a732ef reshape shape expression, drop reshape permute, test reshape oom (#5918) 2025-03-10 15:31:34 +08:00
nihui 1e4daff075 fix ncnn tools crash with compound layer creation, write gemm weight data (#5416)
* fix ncnn tools crash with compound layer creation

* write gemm weight data
2024-04-10 15:09:08 +08:00
zhiliu6 814f89ef1a Fuse HardSwish activation into Convolution and InnerProduct (#3233)
* add general fused activation
* add NCNN_FORCE_INLINE option
2021-10-11 15:55:43 +08:00
nihuini 618f0f70ac fuse 1x1xc broadcasting add into convolution 2021-07-26 14:56:37 +08:00
nihui 4f135e07bf implement convolution1d and pooling1d (#3035)
* implement convolution1d and pooling1d

* add conv1d pool1d test

* fuse convolution1d activation

* update operator doc

* fix vulkan adpative pooling
2021-06-30 20:19:19 +08:00
nihuini 1ad37fae1e generate random weight when null bin passed 2021-05-24 15:54:12 +08:00
nihuini 26dc9820e4 custom mlir ncnn optimize pass, add efficientnetv2_b0 benchmark 2021-05-19 16:34:18 +08:00
nihuini 56d74580a0 fix uninitialized input and weight 2021-04-15 17:45:12 +08:00
nihuini 2b1f8bea25 fix float locale issue in ncnn2mem, fix long line parsing in ncnn2int8 2021-04-14 18:59:28 +08:00
nihui 7e1aaa5828 cmake option NCNN_INT8 (#2839) 2021-04-14 12:49:35 +08:00
nihui 5fe75f19ef architecture changes for int8 packing (#2771)
* quantize and dequantize tests

* unify activation and usability function

* drop NCNN_REQUANT cmake option, test dequantize requantize pack8, fix webassembly build

* benchmark use requantize int8 model
2021-03-27 18:49:13 +08:00
restyled-io[bot] 5f00ba89d2 feat(ncnnoptimize): replace denormals to zero on layers with weights (#2690)
* feat(ncnnoptimize): replace denormals to zero on layers with weights

Co-authored-by: youngsoo.lee <youngsoo15.lee@gmail.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2021-03-22 10:26:57 +08:00
nihui 19c183cacc fix ncnnoptimize default cut range 2021-03-21 22:47:35 +08:00
restyled-io[bot] 5e565cfa8a Restyle add net Cut Function (#2763)
* add ncnnoptimise cut net function

* add ncnnoptimise cut net function

* Restyled by clang-format

* Restyled by astyle

* Restyled by clang-format

* Restyled by astyle

Co-authored-by: chenty <admin@chenty.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2021-03-19 22:14:37 +08:00
nihui d3d16d2413 fix ncnnoptimize crash on models with multiple custom layers 2021-02-18 21:46:06 +08:00
nihuini a1839f6bce fix ncnnoptimize shufflechannel reverse mode 2021-02-09 11:44:04 +08:00
nihui b01728a3be fix crash when eliminating memory footprint on undefined blobs, fix #2609 2021-01-23 11:59:47 +08:00
nihui 4f2907d129 arm neon optimization for rnn (#2601) 2021-01-15 15:40:45 +08:00
Guoxia Wang 609f63c57e support PyTorch AdaptiveAvgPool2d and AdaptiveMaxPool2d (#2546)
* support pytorch adaptive pool
* support onnx2ncnn adaptive pool convert
* support ncnnoptimize adaptive pool param write

* fix adaptive pool out_shape order

* fix adaptive pool out_shape order, H and W can be either a int
add test case, set support_vulkan = false Pooling_vulkan::create_pipeline

* review adaptive pool

* fix typo

* add adaptive pool forward in pooling_x86.cpp pooling_arm.cpp
fix out_w, out_h id naming convention

* fix typo

* don't support packing, bf16, int8, image for adaptive pool

* Restyled by clang-format

* Restyled by astyle

* Restyled by clang-format

* Restyled by astyle

Co-authored-by: Restyled.io <commits@restyled.io>
2021-01-07 08:39:06 +08:00
nihui 54c0a13b9f build shared library (#2525)
* build shared lib and enable lto

* reserved for layer and option

* allocator pimpl

* datareader pimpl

* paramdict pimpl, disable copy assign for allocator and datareader

* modelbin pimpl

* net extractor pimpl

* gpu pimple

* disable copy assign vulkandevice, code format

* command pimpl, dummy image readonly

* pipeline pipelinecache pimpl, export platform class

* code format, export simple family

* update ci

* disable lto on android armv7, merge webassembly ci

* link libgcc, fix macos dylib version

* pipeline pimpl, gpu info pimpl

* destroy gpu info after vulkan device

* ignore msvc stl class warning

* fix ncnn_paramdict_get_float return type

* fix vktransfer upload fp16 without flatten, add command test
2021-01-01 22:55:10 +08:00
nihuini fbf0ffda53 pixelshuffle nhwc mode, convert onnx DepthToSpace mode DCR, convert mlir tf.DepthToSpace 2020-12-29 19:47:53 +08:00
nihuini b35b06be6d reorg nhwc mode, code format 2020-12-29 18:57:48 +08:00
nihui 343bc3b7dc single blob consumer (#2493) 2020-12-25 00:21:14 +08:00
nihui 0f7b3b4461 aborted is not error, use skipped instead 2020-12-25 00:13:46 +08:00
nihuini 38b6387bc5 ncnnoptimize and ncnn2mem now accepts weight-less custom layer 2020-12-17 15:54:33 +08:00
Zhuo Zhang d8866eba56 fix tools/ncnnoptimize.cpp sign-compare warning (#2393) 2020-12-05 17:22:29 +08:00
nihui ba364791e8 reshape x86 pack4 2020-11-26 00:07:14 +08:00
nihui 60b6cc32ef replace_reduction_with_global_pooling replace_prelu_with_leaky_relu 2020-11-22 18:35:40 +08:00
nihuini 7836a143ec print input and output blob names, print estimated runtime memory footprint 2020-11-12 16:58:07 +08:00
nihuini 88d1efc9b1 convert onnx MatMul to Gemm 2020-11-03 17:50:55 +08:00
nihuini d0e6b256f9 drop obsoleted aarch64 auto conv mode, print mac after ncnnoptimize shape inference 2020-10-29 14:22:12 +08:00
nihuini ac47a05488 fix onnx groupnorm conversion, ncnnoptimize support groupnorm, fix #2142 2020-10-26 20:09:15 +08:00
nihuini 0a533dcaac mlir2ncnn fuse keras batchnorm, handle instancenorm affine in ncnnoptimize 2020-10-26 16:11:55 +08:00
Zhuo Zhang 0fc5ee1383 fix #2056 (#2057) 2020-09-01 15:04:14 +08:00
nihuini ea17a46b34 fuse memorydata split binaryop 2020-08-24 15:13:32 +08:00
Tijmen Verhulsdonck a3f7d2d520 Fix padding in ncnnoptimize not outputting all the params (#1944) 2020-07-20 16:41:15 +08:00
nihui 6e340f5e79 MLIR converter (#1810)
* tf2sb

* wip

* wip

* concat maxpool avgpool

* StridedSlice

* handle stridedslice mask

* convert mlir deconvolution

* convert deconvolution output shape

* convert tanh

* code format
2020-07-02 14:15:28 +08:00
nihui 3ef995ed1e format code style and setup restyled.io (#1840) 2020-06-13 22:17:51 +08:00
JackieWu ce2251db05 Improve ROIAlign (accelerate ROIAlign, support sampling ratio and aligned ROIAlign) (#1820)
* update roialign

* update tool for roialign

* fix ceil for roialign

* fix ios build

* fix

* fix

* make it compatibile with the old version

* fix ios build

* trigger CI

* fix test

* order

* build

* remove code

* merge roialign

* accelerate ROIAlign

* update note

* rename func

* roialign version

* trigger CI

* fix roialign

* use ref for pre-calc in roialign

* retrigger CI

* pre-alloc
2020-06-08 21:40:24 +08:00
zhiliu6 3bfabf1d6a Add fused convolution and mish layer support. (#1761) 2020-05-17 13:14:09 +08:00
nihuini 092d529d66 fuse rsub rdiv with scalar 2020-05-15 13:35:01 +08:00
nihuini e6a04d1535 fuse_memorydata_binaryop fuse_binaryop_eltwise 2020-05-11 19:43:00 +08:00
nihui 8a84077429 ncnnoptimize lstm 2020-03-15 11:56:23 +08:00
nihui dba992c15c ncnnoptimize add pixelshuffle, fix #1608 2020-03-12 20:54:50 +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
kalcohol 01853010ea type conversion and MSVC _CRT_SECURE_NO_DEPRECATE warning fix (#1524)
* fix type conversion warning

* fix MSVC _CRT_SECURE_NO_DEPRECATE warning

* type conversion: missing one

* fix  MSVC _CRT_SECURE_NO_DEPRECATE warning and type warning

* reformat

* convert google::protobuf::int64 to size_t to avoid type impl between msvc and gcc gap

* remove C++11 auto

* tab -> space
2020-02-07 14:33:01 +08:00
nihui e2bd4eae6e write shape as 4-number tuple 2020-01-31 12:34:57 +08:00
nihui 6cefaad957 ncnnoptimize shape inference, load shape hint 2020-01-30 16:33:44 +08:00
Sungmann Cho 447b1369f5 Fix warnings on Visual Studio (#1422)
* Change DataReader::read()'s signature to fix warning C4267

This CL fixes lots of warning "C4267: 'initializing': conversion from
'size_t' to 'int'" in our codebase by matching DataReader::read()'s
signature to fread().

* Fix warnings C4244 and C4267 in tools/ncnnoptimize.cpp

C4244: 'initializing': conversion from 'double' to 'float',
    possible loss of data
C4267: 'initializing': conversion from 'size_t' to 'int',
    possible loss of data

* Fix warning C4244 in src\layer\selu.cpp

C4244: '=': conversion from 'double' to 'float', possible loss of data

* Fix warning C4244 in src\layer\cast.cpp

C4244: '=': conversion from 'double' to 'float', possible loss of data
C4244: 'return': conversion from 'float' to 'signed char', possible loss of data

* Fix warning C4244 in src\layer\psroipooling.cpp

C4244: 'initializing': conversion from 'double' to 'float',
    possible loss of data
C4244: 'initializing': conversion from 'double' to 'int',
    possible loss of data
2019-12-13 16:19:13 +08:00