Commit Graph
54 Commits
Author SHA1 Message Date
nihui 241524ffce discard weight memory for x86 arm vulkan (#3865)
* discard weight memory for x86 and vulkan
* drop arm innerproduct weight
* drop arm convolution weight
* drop arm convolutiondepthwise weight
* drop x86 vulkan deconvolution deconvolutiondepthwise weight
* drop arm deconvolution deconvolutiondepthwise weight
* arm neon assembly optimization for innerproduct pack4
2022-06-01 10:16:35 +08:00
f10cc6dd93 initial data structure changes for 3dcnn, conv3d, pooling3d (#3378)
Co-authored-by: ElvisYu <elvisyuovo@gmail.com>
Co-authored-by: 余浩文 <m18107220188@163.com>
Co-authored-by: Zr2223 <67497651+Zr2223@users.noreply.github.com>
2021-12-02 16:50:55 +08:00
nihui 24fbb6e8cb honor thread setting on load and vulkan command, ci avx512 t4 (#3391) 2021-12-01 16:36:37 +08:00
nihui 052b2a1653 apply code-format changes 2021-07-17 23:37:32 +00:00
chenxiemin 9bd8a50b96 fix vulkan memory leak issue (#3088) 2021-07-18 07:36:08 +08:00
nihui 9fd4d371ae bridge image for adreno image upload and download (#2658)
* add bridge image for adreno image storage upload and download

* enable sbn1, print bugbilz flag

* blacklist old adreno

* let user choose use_image_storage option even when bug_storage_buffer_no_l1
2021-02-10 11:05:45 +08:00
nihuini 77db369cae fix upload data may be invalidated by previous pipelines with the same memory on integrated device, fix #2640 2021-02-02 16:47:08 +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
nihui 79efe33fdc cmake option for platform api uses (#2502)
* cmake option for platform api uses
* adroid gpu ci does not rely on glslangvalidator, add android termux ci
2020-12-25 11:24:56 +08:00
nihui 4463c3b455 disable image shader on adreno until a better workaround figured out 2020-10-10 00:09:45 +08:00
nihuini b766c8cd9e fix potential divide by zero fault when bf16s / fp16s enabled, fix #2125 2020-09-16 16:28:59 +08:00
Leo 5afd318b86 Support remove libstdc++ denpendency (#2030)
* [build] add toolchain file w/o stdcxx dependency

* [build] link m and gcc lib explicitly

* [ncnn] complete simple stl impl

* [ncnn] adapt for ncnn simplestl

* [test] adapt for ncnn simplestl

* [ncnn] fix missing algorithm and list when simplestl disabled

* [ncnn] fix guard for operator new and delete

* [style] fix the code style

* [build] fix build failed on darwin and emscripten

* [ci] do not import cxx to avoid operator conflict

* [ncnn] add temporary partial_sort impl using bubble sort

heap sort should be used for better perf.

* [ncnn] add std greater and less function

* [ncnn] fix placement new operator overload

* [ncnn] add operator delete with size info

* [build] disable exception, rtti, example and tools when simplestl on

* [build] add toolchain for arm simplestl

* [build] add toolchain for aarch64 simplestl

* [ncnn] move initializer to constructor

* [ncnn] use deteiled type instead of auto

* [ncnn] use plain lib name in target_link_libraries
2020-08-28 09:20:56 +08:00
ncnnnnn e2557c1678 fix UNIT64_MAX not declared #2009 (#2010) 2020-08-07 16:04:18 +08:00
nihui 3ef995ed1e format code style and setup restyled.io (#1840) 2020-06-13 22:17:51 +08:00
nihui 478e15d7dc fix memorydata test on nvidia gpu 2020-06-03 00:31:58 +08:00
nihuini f87f21779f resolve cast from type properly, no more fp16p to/from fp16s conversion 2020-06-02 19:54:54 +08:00
nihuini bb56b5439f fix vkmat download on integrated gpu, workaround priorbox fp16s with online spirv, fix #1700 fix #1805 2020-06-02 15:12:17 +08:00
nihui 2133121e6d destroy descriptorsets properly 2020-05-27 23:39:20 +08:00
nihui 85fb76a6b9 clear all internal state on command reset 2020-05-27 22:09:10 +08:00
Naiyang Lin ceef2470a5 Add logger.h (#1753) 2020-05-12 19:33:21 +08:00
nihui 9a9a618229 image storage is mandatory, less options makes life easier 2020-05-08 00:09:35 +08:00
nihuini 041437ef48 seperate packing cast type to more shaders 2020-05-07 17:27:23 +08:00
nihui e8688b042f fuse packing cast storage, binaryop image shader, dummy buffer and image, device-wide utility packing converter operators, fix multi-blob layer test 2020-05-05 21:31:07 +08:00
nihui 62da1228e1 adreno image shader + fp16 + fp16a (#1714)
* wip

* wip

* fix

* image and imageview can not be destroyed until command execution ends

* fast copy path for tightly packed data

* wip

* texture load works

* 1d 3d image

* record clone image, multiple commands share one image reference

* upload download image

* layer forward accept vkimagemat

* vkimagemat graph works

* staging vkimagemat for passing dynamic parameters, macro for fp32+image shader, padding image shader

* vkimagemat elemsize

* convolution test pass

* conv1x1s1 image shader

* fast staging image allocator from host memory, pooling image shader

* convolutiondepthwise image shader

* innerproduct image shader

* packing image shader

* crop deconvolution image shader

* resolve spirv binding types

* image fp16 and fp16a, cast image shader

* eltwise image shader

* wip

* absval image shader

* deconvolutiondepthwise image shader

* concat image shader, squeezenet works

* noop split image shader

* uniform precision hint

* layer support_image_storage

* wip

* vulkan device utility operator

* command is storage and packing option aware

* fallback to cpu on image allocation failed, mobilenetssd works

* flatten image shader, enable more test

* ci test

* check imgfp32 imgfp16 imgfp16a features

* fix ci test

* fix ci test

* upgrade swiftshader

* wip

* opt aggressive

* imgfp16p

* opt none

* convolution winograd image shader

* fix flush range, fast copy path for continous buffer

* minor fix

* fix innerproduct

* wip ...

* wip

* cast fix

* packing test

* wip

* image fp16p is fp16p

* wip

* silence

* more line info

* code clean

* softmax image shader
2020-04-30 17:08:30 +08:00
nihui 7365bb80a2 vkmat and command api breaks (#1689)
* vkmat and command api breaks

* always use compute queue for compute buffer transfer

* no barrier for readonly weight buffer

* record clone, drop queue_owner

* bring back layer forward

* fix validation errors

* lifecycle inside command makes life easier

* update doc

* record_import_android_hardware_buffer
2020-04-12 13:14:20 +08:00
nihuini 1469bc8b19 reclaim immediately after submitting, so we don't block the queue access during the long-time waiting fence, fix #1682 2020-04-09 13:06:42 +08:00
nihuini 64ce9bc847 staging buffer has its offset 2020-01-07 19:24:49 +08:00
nihuini b361b24832 do not enforce coherent memory type, queue transfer after uploading model weight 2020-01-02 16:51:33 +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
nihuini a86c2f44c3 vkimagemat, vkimageallocator, convenient construct from android hardware buffer 2019-12-25 14:34:34 +08:00
nihui 4a3c70f5b8 import android hardware buffer, fix #1329 2019-12-08 22:36:48 +08:00
nihuini c4f23ae8ad rename Mat packing to elempack 2019-07-22 21:19:01 +08:00
nihuini 73911492d7 fix validation warning on querypool destruction, enable fp16p by default 2019-06-10 19:51:27 +08:00
nihuini e09607bc22 add option to upload model function, pipeline creation honors option use flags, setting allocator per extractor do not make much sense 2019-06-05 19:03:39 +08:00
nihuini cd7559c639 more fix for fp16p, still disabled by default 2019-05-29 11:13:16 +08:00
nihui 25b9736f82 shader fp16 packed 2019-05-26 19:33:41 +08:00
nihuini 37e150162a do not retrieve timestamp availabitliy bits 2019-05-22 14:45:00 +08:00
nihuini 738fb6bb14 print gpu per layer benchmark 2019-05-22 11:26:28 +08:00
nihuini c9a9486307 merge command submit and wait, expose queue_count, concurrent queue submission shall work 2019-05-20 19:51:30 +08:00
nihuini 5d86014d9c add missing barrier for transfer dst, fix softmax pack4, fix #932 2019-04-24 16:16:26 +08:00
nihuini 4729ea3505 bottom blob memory never alias, reuse blob memory more elegantly relying on refcount 2019-04-23 14:45:56 +08:00
nihui d753fe2589 upload fp16 weight, enable fp16 storage and arithmetic 2019-03-23 10:34:55 +08:00
nihuini 37573aeeb5 remove unused record download 2019-03-22 11:16:51 +08:00
nihuini d3a11eb6c9 one codepath for unified and discrete device 2019-03-13 19:14:16 +08:00
nihuini 433a92401a auto barrier in pipeline and copy command 2019-03-13 17:33:36 +08:00
nihuini 85a28959e4 fix binaryop shader binding, use shared buffer state, fix blob copy in non-light mode, fix #817 2019-03-07 15:18:48 +08:00
nihui b49cb56ad9 constify vulkan device handle, use default local vulkan device if not specified 2019-03-03 11:27:04 +08:00
nihui 68afd1fa17 reset fence 2019-03-02 15:51:29 +08:00
nihuini bdd305638d command reset 2019-03-01 20:49:28 +08:00
nihuini 7312887671 transfer command hold data context 2019-02-20 14:52:53 +08:00