- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
//
|
|
|
|
// Utils.cpp
|
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2019/07/26.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "Utils.hpp"
|
|
|
|
#include <map>
|
2022-12-30 15:18:58 +08:00
|
|
|
#include <set>
|
|
|
|
#include <stack>
|
2024-06-03 20:09:34 +08:00
|
|
|
#include <MNN/expr/ExecutorScope.hpp>
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
#include "MNN_generated.h"
|
2019-12-27 22:16:57 +08:00
|
|
|
#include "core/TensorUtils.hpp"
|
2024-11-18 14:37:45 +08:00
|
|
|
#include "core/OpCommonUtils.hpp"
|
2022-12-30 15:18:58 +08:00
|
|
|
#include "core/Session.hpp"
|
2020-11-05 16:41:56 +08:00
|
|
|
#include "core/MNNMemoryUtils.h"
|
2020-12-14 18:11:56 +08:00
|
|
|
#include "core/Backend.hpp"
|
|
|
|
#include "core/Execution.hpp"
|
2021-01-06 16:29:37 +08:00
|
|
|
#include "core/ConvolutionCommon.hpp"
|
2020-12-14 18:11:56 +08:00
|
|
|
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
namespace MNN {
|
|
|
|
namespace Express {
|
2020-11-05 16:41:56 +08:00
|
|
|
Expr::Inside::Inside(int outputSize) {
|
|
|
|
mOutputInfos.resize(outputSize);
|
|
|
|
mOutputTensors.resize(outputSize);
|
|
|
|
for (int i=0; i<outputSize; ++i) {
|
|
|
|
mOutputTensors[i] = new Tensor;
|
|
|
|
TensorUtils::getDescribe(mOutputTensors[i])->memoryType = Tensor::InsideDescribe::MEMORY_HOST;
|
|
|
|
}
|
|
|
|
}
|
2021-04-08 15:34:23 +08:00
|
|
|
Expr::Inside::Inside(Tensor* tensor, bool own) {
|
2021-01-06 16:29:37 +08:00
|
|
|
mOutputInfos.resize(1);
|
|
|
|
mOutputTensors.resize(1);
|
|
|
|
mOutputTensors[0] = tensor;
|
|
|
|
Utils::copyTensorToInfo(&mOutputInfos[0], tensor);
|
|
|
|
mOutputInfos[0].syncSize();
|
2021-04-08 15:34:23 +08:00
|
|
|
mOwnTensor = own;
|
2021-01-06 16:29:37 +08:00
|
|
|
}
|
|
|
|
|
2020-11-05 16:41:56 +08:00
|
|
|
Expr::Inside::~Inside() {
|
2021-01-06 16:29:37 +08:00
|
|
|
if (mOwnTensor) {
|
|
|
|
for (auto t : mOutputTensors) {
|
|
|
|
delete t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (nullptr != mHostTensor) {
|
|
|
|
delete mHostTensor;
|
2020-11-05 16:41:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-12-27 22:16:57 +08:00
|
|
|
#define CONVERT(src, dst, f)\
|
|
|
|
if (f == src) return dst;
|
|
|
|
|
- build:
- unify schema building in core and converter;
- add more build script for android;
- add linux build script for python;
- ops impl:
- add floor mod support in binary;
- use eltwise impl in add/max/sub/mul binary for optimization;
- remove fake double support in cast;
- fix 5d support for concat;
- add adjX and adjY support for batch matmul;
- optimize conv2d back prop filter;
- add pad mode support for conv3d;
- fix bug in conv2d & conv depthwise with very small feature map;
- optimize binary without broacast;
- add data types support for gather;
- add gather ND support;
- use uint8 data type in gather v2;
- add transpose support for matmul;
- add matrix band part;
- add dim != 4 support for padding, reshape & tensor convert;
- add pad type support for pool3d;
- make ops based on TensorFlow Lite quantization optional;
- add all & any support for reduction;
- use type in parameter as output type in reduction;
- add int support for unary;
- add variable weight support for conv2d;
- fix conv2d depthwise weights initialization;
- fix type support for transpose;
- fix grad outputs count for reduce grad and reshape grad;
- fix priorbox & detection output;
- fix metal softmax error;
- python:
- add runSessionWithCallBackInfo interface;
- add max nodes limit (1400) for visualization tool;
- fix save error in python3;
- align default dim;
- convert:
- add extra design for optimization;
- add more post converting optimizers;
- add caffe v1 weights blob support;
- add cast, unary, conv transpose support for onnx model;
- optimize batchnorm, conv with variable weights, prelu, reshape, slice, upsample for onnx model;
- add cos/sin/atan/tan support for unary for tensorflow model;
- add any/all support for reduction for tensorflow model;
- add elu, conv3d, pool3d support for tensorflow model;
- optimize argmax, batchnorm, concat, batch to space, conv with variable weights, prelu, slice for tensorflow model;
- others:
- fix size computer lock;
- fix thread pool deadlock;
- add express & parameters in express;
- rewrite blitter chooser without static map;
- add tests for expr;
2019-10-29 13:37:26 +08:00
|
|
|
int Utils::convertFormat(Dimensionformat format) {
|
2019-12-27 22:16:57 +08:00
|
|
|
CONVERT(NCHW, MNN_DATA_FORMAT_NCHW, format);
|
|
|
|
CONVERT(NHWC, MNN_DATA_FORMAT_NHWC, format);
|
|
|
|
CONVERT(NC4HW4, MNN_DATA_FORMAT_NC4HW4, format);
|
|
|
|
return MNN_DATA_FORMAT_UNKNOWN;
|
- build:
- unify schema building in core and converter;
- add more build script for android;
- add linux build script for python;
- ops impl:
- add floor mod support in binary;
- use eltwise impl in add/max/sub/mul binary for optimization;
- remove fake double support in cast;
- fix 5d support for concat;
- add adjX and adjY support for batch matmul;
- optimize conv2d back prop filter;
- add pad mode support for conv3d;
- fix bug in conv2d & conv depthwise with very small feature map;
- optimize binary without broacast;
- add data types support for gather;
- add gather ND support;
- use uint8 data type in gather v2;
- add transpose support for matmul;
- add matrix band part;
- add dim != 4 support for padding, reshape & tensor convert;
- add pad type support for pool3d;
- make ops based on TensorFlow Lite quantization optional;
- add all & any support for reduction;
- use type in parameter as output type in reduction;
- add int support for unary;
- add variable weight support for conv2d;
- fix conv2d depthwise weights initialization;
- fix type support for transpose;
- fix grad outputs count for reduce grad and reshape grad;
- fix priorbox & detection output;
- fix metal softmax error;
- python:
- add runSessionWithCallBackInfo interface;
- add max nodes limit (1400) for visualization tool;
- fix save error in python3;
- align default dim;
- convert:
- add extra design for optimization;
- add more post converting optimizers;
- add caffe v1 weights blob support;
- add cast, unary, conv transpose support for onnx model;
- optimize batchnorm, conv with variable weights, prelu, reshape, slice, upsample for onnx model;
- add cos/sin/atan/tan support for unary for tensorflow model;
- add any/all support for reduction for tensorflow model;
- add elu, conv3d, pool3d support for tensorflow model;
- optimize argmax, batchnorm, concat, batch to space, conv with variable weights, prelu, slice for tensorflow model;
- others:
- fix size computer lock;
- fix thread pool deadlock;
- add express & parameters in express;
- rewrite blitter chooser without static map;
- add tests for expr;
2019-10-29 13:37:26 +08:00
|
|
|
}
|
|
|
|
|
2020-02-26 23:08:52 +08:00
|
|
|
DataType Utils::convertDataType(halide_type_t type) {
|
2024-11-18 14:37:45 +08:00
|
|
|
return OpCommonUtils::convertDataType(type);
|
- build:
- unify schema building in core and converter;
- add more build script for android;
- add linux build script for python;
- ops impl:
- add floor mod support in binary;
- use eltwise impl in add/max/sub/mul binary for optimization;
- remove fake double support in cast;
- fix 5d support for concat;
- add adjX and adjY support for batch matmul;
- optimize conv2d back prop filter;
- add pad mode support for conv3d;
- fix bug in conv2d & conv depthwise with very small feature map;
- optimize binary without broacast;
- add data types support for gather;
- add gather ND support;
- use uint8 data type in gather v2;
- add transpose support for matmul;
- add matrix band part;
- add dim != 4 support for padding, reshape & tensor convert;
- add pad type support for pool3d;
- make ops based on TensorFlow Lite quantization optional;
- add all & any support for reduction;
- use type in parameter as output type in reduction;
- add int support for unary;
- add variable weight support for conv2d;
- fix conv2d depthwise weights initialization;
- fix type support for transpose;
- fix grad outputs count for reduce grad and reshape grad;
- fix priorbox & detection output;
- fix metal softmax error;
- python:
- add runSessionWithCallBackInfo interface;
- add max nodes limit (1400) for visualization tool;
- fix save error in python3;
- align default dim;
- convert:
- add extra design for optimization;
- add more post converting optimizers;
- add caffe v1 weights blob support;
- add cast, unary, conv transpose support for onnx model;
- optimize batchnorm, conv with variable weights, prelu, reshape, slice, upsample for onnx model;
- add cos/sin/atan/tan support for unary for tensorflow model;
- add any/all support for reduction for tensorflow model;
- add elu, conv3d, pool3d support for tensorflow model;
- optimize argmax, batchnorm, concat, batch to space, conv with variable weights, prelu, slice for tensorflow model;
- others:
- fix size computer lock;
- fix thread pool deadlock;
- add express & parameters in express;
- rewrite blitter chooser without static map;
- add tests for expr;
2019-10-29 13:37:26 +08:00
|
|
|
}
|
2020-02-26 23:08:52 +08:00
|
|
|
halide_type_t Utils::revertDataType(DataType dataType) {
|
2019-12-27 22:16:57 +08:00
|
|
|
CONVERT(DataType_DT_FLOAT, halide_type_of<float>(), dataType);
|
|
|
|
CONVERT(DataType_DT_INT32, halide_type_of<int32_t>(), dataType);
|
|
|
|
CONVERT(DataType_DT_INT64, halide_type_of<int32_t>(), dataType);
|
|
|
|
CONVERT(DataType_DT_UINT8, halide_type_of<uint8_t>(), dataType);
|
|
|
|
CONVERT(DataType_DT_INT8, halide_type_of<int8_t>(), dataType);
|
[MNN:Sync] Sync internal github
Commits:
8148ae75c 弗人 bugfix
14cb8ec7f 弗人 [Converter:Bugfix] bugfix for onnx depthwise convtranspose
476fbcd90 雁行 [MNN:Feature] Open AVX cast and bugfix for contentCFG.
5e26b9fd3 雁行 [Test:Feature] Add android test.
37e147b25 雁行 [MNN:Bugfix] Bugfix for floordiv.
144c185f5 tianbu.xsw hangxing fix hiai
b4fd429d6 tianbu.xsw updateCacheFile bugfix -- update cache size
d4ba572a8 雁行 [MNN:Bugfix] Support int8 in AVX2 and some Bugfix.
43061f07e xiaying [MNN:Bugfix] Fix bug for module mode run part of model
398cc5ab6 tianhang.yth refactor demo
736380600 xiaying [Express:Bugfix] Fix memory leak for copy branch
b8dab0a27 tianhang.yth MNNFloat2Int8 sizeQuad=0 crash fix
94b95bfed ghz [BugFix]1.Better method for fast pack valid check
6a921f85e xiaying [Converter:Bugfix] Fix bug for Fuseconsttosubgraph
5f77ae889 tianhang.yth numThread bugfix
a807ef879 tianhang.yth add createSession(configs, runtimeinfo) API, add pymnn demo, pymnn logcat bugfix
ad05409d3 xiaying [MNN:Bugfix] Fix bug for StaticModule's sizecompute overflow, add error print for module mode
9d81b8299 xiaying [MNN:Bugfix] Fix bug for Unique op for output size = 1
03b15e9af xiaying [Test:Feature] Add MatMulBConst Test, Fix bug for single Convert
c944a76ee tianhang.yth add auto backend and getSessionInfo @tianbu
91fa7267b ghz [BugFix]1.fix the error in eP check
bf0041f77 ghz [BugFix]1.Fix the logic error in eP check. 2.Fix the sp align error
693871672 雁行 [CPU:Bugfix] rm adrp instruction for clang compiler bug.
1b8f6b3d8 ghz 1.Fix the wronly use of r13 in arm32 version. 2.Fix the missing callee register save and restore process.
feb7ecc4c 弗人 modify log of python offline quant
040c04811 ghz [BufFix]1.replace platform-related regs. 2.fix the same problem in arm32 version
609f37db8 弗人 add log for python quant, python convert
5511dd30a ghz [BugFix]1.Add testcases in SparseConv to check all functional code branch. 2. Fix the bug in "MNNPackC4ForMatMul_A.S" in arm64, which is caused by the missing check of eReal parameter.
a93ff9280 tianhang.yth add tf.Unique op support
9729ff773 allen.lk [Bugfix] Fix one arm32 instruction syntax that clang works but gcc DOES NOT work. use index instruction instead.
297c1ad14 雁行 [Expr:Bugfix] bugfix for tensor content used by shape compute.
ef8c369e3 弗人 catch exception
07c2dd670 弗人 add dependence to setup, base64 encode url, add time log
177e590c1 弗人 [Python:Feature] add aliyun log for python quant tool
40a7928cf allen.lk [Debug:Sparse] 1.Add group parameter in torchscript converter. 2. Stop split running to avoid memory corruption when check failed in TransformGroupConvolution 3. fix Op split issue in TransformGroupConvolution
3bdea84a1 allen.lk [Debug:Sparse] Fix and warning one kind of segmentfault cause by memory corruption when resize ConvolutionWinograd. Avoid to use some registers as arm restriction.
c3c6fbdbd allen.lk [Debug:Sparse] Fix and warning one kind of segmentfault cause by memory corruption when resize ConvolutionWinograd. Avoid to use some registers as arm restriction.
bc590eee4 雁行 [Converter:Bugfix] bugfix for onnx instancenormalization convert.
d8918593f tianhang.yth add auto backend and getSessionInfo @tianbu
83a198ed7 杭行 update
d0dd3e09b 杭行 update
99540202e xiaying [Converter:Optimize] Opt the tensor convert insert
333d8db82 allen.lk [Debug:Sparse] Fix All platform-register r9 / x18 issue on arm32 and arm64.
db5994672 杭行 merge
6293de7b8 tianbu.xsw fix pymnn updateCacheFile
5c2e11cb1 tianbu.xsw do updateCache in createSession
6e7641ff4 tianbu.xsw do not limit cacheFile for a model
5287a65e4 tianbu.xsw bugfix
52ba53a91 tianbu.xsw revert pymnn api
60284d830 tianbu.xsw bugfix
6d8077490 tianbu.xsw rename updateCacheFile api params
3cb172710 tianhang.yth updateCacheFile API size default value is 0
c5b69aabf tianbu.xsw updateCacheFile python api fix
5d5da7aa5 tianbu.xsw reflector code
5707877a4 雁行 [MNN:Speed] Speedup for softmax in x86 and arm.
2a211825c tianbu.xsw reflector code for updateCacheFile
76db3a835 tianbu.xsw [Cache Feature]: Add updateCacheFile API for increment cache
b06b0fd43 allen.lk [Debug:Sparse] Fix and warning one kind of segmentfault cause by memory corruption when resize ConvolutionWinograd. Avoid to use some registers as arm restriction.
e68bfa495 雁行 [Converter:Feature] Add UUID when model convert.
a9cb935dc xiaying [MNN:Speed] Support c4nhwc for more fastblit
019f40353 xiaying [Converter:Refractor] Reduce memory used by MNNConvert(bert from 5G -> 1G)
d2a6d3d05 xiaying [MNN:Bugfix] Fix bug for identity output not find
604d0801b xiaying [Converter:Bugfix] Fix bug for FuseGeLu
4bada2367 xiaying [MNN:Refractor] SegmentMean rewrite as segment
82070e708 xiaying [MNN:Bugfix] Fix bug for GeometryBinary
e8ea4266e xiaying Fix bug for ShapeTensorConvert compute for dim = 1 error
1f1cf1991 xiaying [Tools:Bugfix] Fix system compability for fastTestOnnx
6f422efe2 xiaying [Tools:Bugfix] Remove color for checkDir for easy to dump
968f7ec88 xiaying [MNN:Speed] Support turn broadcast binary to loop
3e7aaf46f xiaying [MNN:Refractor] Set Convolution1x1Strassen support variable input/output ptr
1f65ab163 xiaying [MNN:Bugfix] Fix bug for mini mnn can't convert model
d65953d47 xiaying [MNN:Bugfix] Fix bug for armv7a - android-14 + ARM82
8b68be45c xiaying [MNN:Feature] Add segment
8a8f264f5 xiaying [Vulkan:Bugfix] Remove unuseful print
025bb0fda xiaying [Converter:Bugfix] Fix bug for oneof don't support
43900251e tianbu.xsw enable setCacheFile python API
ebfb05c74 tianbu.xsw [Metal Feature] support metallib obtain from walle transfer task
9665c0a79 弗人 add check for path in json file
c66fef224 xiaying [Converter:Bugfix] Fix bug for oneof don't support
42f192852 xiaying [MNN:Bugfix] Fix bug for not set output / saveTensor into origin Schedule's outputs
1b95354ff 雁行 [Feature]: Support shape compute for SetDiff1D, and null input for Prod.
83966d043 xiaying [Test:Feature] Add test for static module
42d1be933 xiaying [Converter:Bugfix] Fix bug for mnn convert and static model add more outputs for origin model
9067531c3 xiaying [Converter:Refractor] formatLicence
99558bed9 xiaying [Converter:Bugfix] Count the op for unuseful and controlflow
4f6da0fa7 allen.lk [Feature:GRUMultiOutput] fix multi output dimension type
c6b219bce xiaying [Converter:Feature] Turn torch converter to object
dd4e68a37 xiaying [Converter:Feature] Support dump supported ops
80b6a60a3 xiaying [Converter:Info] If has output name, print output name instead of computed
015278fc3 xiaying [MNN:Refractor] Revert IfModule's debug info
23ac967c4 xiaying Don't transform for multi-input convolution/deconvolution
b02b0d4de xiaying Fix bug for multi-input for conv1d
254d8b1d4 xiaying Fix bug for Conv1dSqueezeMove for multi input convolution 1d
d47d0b9ca xiaying Fix bug for CPURaster's fuse nc4hw4
357c5bd33 xiaying Fix ConvBiasAdd for conv's inputs op > 1
55b1f0c9c xiaying [Converter:Bugfix] Don't transform for multi-input convolution/deconvolution
1902a30f5 xiaying [Converter:Bugfix] Fix bug for Conv1dSqueezeMove for multi input convolution 1d
c23fe617b xiaying [MNN:Bugfix] Fix bug for multi-input for conv1d
8ff018426 xiaying [MNN:Bugfix] Fix bug for CPURaster's fuse nc4hw4
d4e8cd602 xiaying [Converter:Bugfix] Fix ConvBiasAdd for conv's inputs op > 1
846266b42 tianbu.xsw return when program and tune both nullptr
fd67c76a9 xiaying [Converter:Bugfix] DepthwiseConvWeightMerge only valid for tflite
e77a242c4 xiaying [Converter:Feature] Support tflite's half pixel
be054c377 tianbu.xsw [OpenCL Bugfix] do not rewrite cache when binary program is produced
51e65aa35 xiaying [Converter:Feature] Support tflite for fp16 and multi-input convolution
1ccdfdeb5 tianbu.xsw redefine svm macro name
31234d372 tianbu.xsw [OpenCL SVM] add macro for only use wrapper
d739e35da xiaying [MNN:Bugfix] Fix compile bug for grid op
24ab13c79 Joker feat(arm82): add GridSample op support in arm82 backend, AVX(by xiaying)
7b142978e xiaying [AVX512:Speed] Optimize for e <= 8
5f6febe7b tianbu.xsw code refactor
998d91b57 xiaying [Express:Speed] Merge submodule for speed
22c89146f tianhang.yth fix alpha div by zero bug and arm server compile bug
8f829a170 tianbu.xsw [OpenCL Pad] unify conv/deconv pad computing
4a28f603e xiaying [Express:Speed] Shared Const for All Submodule
c74cf28f3 xiaying [MNN:Refractor] Seperate Const init and schedule
2a1eebb7a xiaying [Tools:Bugfix] Fix bug for modelTest.py count size
72f04008c xiaying [MNN:Refractor] Delete unuseful const op
1e735d03c xiaying [Converter:Bugfix] Fix bug for static module gen
4dfadbc6e xiaying [MNN:Refractor] Rewrite const init mode
1fcf0417a xiaying [MNN:Bugfix] Fix bug for deconvolutin multi-input for multi-batch
41d429cfd xiaying [Train:Bugfix] Revert convert NCHW for mnistTrain
f947a5f01 xiaying [Test:Feature] Add testTrain
dad59b6f6 tianbu.xsw move realize code from Backend.hpp to Tensor.cpp
cf4473ad1 xiaying [Train:Bugfix] Support pad for GeometryPoolGrad
91ab13734 xiaying [MNN:Bugfix] Fix compile bug for avx512
742e80f47 xiaying [MNN:Refractor] Opt the logic for checknan judge
12543b841 xiaying [ARM82:Bugfix] Fix compile bug for ios
3a2b0a49f xiaying [ARM82:Speed] Opt Pack / Unpack for armv8
c0f1995cd xiaying [ARM82:Speed] Opt MNNPackC8FP16 and MNNUnpackC8FP16 by asm
e0fc77dcf xiaying [MNN:Speed] Fix bug for DeconvolutionWithStride for C4HW4, open it
584bec578 xiaying [MNN:Bugfix] Fix bug for format set error for onnx
d5bd4148d xiaying [MNN:Bugfix] Fix bug for format set error for onnx
b00265841 xiaying [MNN:Bugfix] Fix bug for SparseConvolutionTiledExecutor
bb09188ac xiaying [Test:Bugfix] Fix bug for run into sparse auto
426d1babd xiaying [MNN:Refractor] Small bugfix for Group convolution and pack
7d0ea1c46 tianbu.xsw [testModel Feature] support testModel.out input resize
4169c54ce xiaying [MNN:Bugfix] Fix bug for checkNAN for origin
412a82222 xiaying [Test:Bugfix] Fix bug for CheckNAN's error of matmul
319b1d425 xiaying [MNN:Bugfix] Fix bug for multi-batch for ConvInt8
050b728a6 xiaying [Test:Bugfix] Use NCHW for ConvInt8Test
7db3423a1 xiaying [OpenCL:Bugfix] Fix bug for opencl::image,opencl::buffer for C4HW4
adcec6a7f xiaying [Vulkan:Bugfix] Fix bug for invalid tensor size limit
d2a7cf4e9 xiaying [Vulkan:Bugfix] Fix bug for onCopyBuffer of nc4hw4
557bebdd3 xiaying [MNN:Bugfix] Fix bug for BF16-ARM32
bbe186649 tianbu.xsw [Update AUTO mode]: fix MNN_FORWARD_AUTO choose priority
6deb23439 xiaying [MNN:Bugfix] Fix bug for GeometryBinary don't care about NC4HW4 same size
b137590e4 xiaying [MNN:Bugfix] Fix bug for GeometryBinary don't care about NC4HW4 same size
7003558ea xiaying [Converter:Bugfix] Fix bug for onnx pad for serveral case
b5f8cae5a xiaying [Converter:Bugfix] Fix bug for onnx pad for serveral case
29b09e125 xiaying [MNN:Bugfix] Fix bug for arm64-bf16
42ce00770 xiaying [MNN:Bugfix] Fix bug for ARM64 - float
a2d89fc18 雁行 [Converter:Feature] Support Binary Unary for Torch.
7f1c0deb1 xiaying [MNN:Bugfix] Fix bug for Raster for Int8
8335a6f18 tianbu.xsw [OpenCL Shared Memory] modify data_format method
b359e031b xiaying [ARM82:Bugfix] Fix bug for arm82 and speed up pack / unpack c8
24bf3fc88 雁行 [Convert:Feature] Support LayerNormFuse without gamma beta.
3e629624b xiaying [MNN:Bugfix] Fix bug for float - armv7a
2b7908ec7 tianbu.xsw modify workItemSize
3cee0d413 xiaying [MNN:Bugfix] test wrong clear
9cbbfb998 xiaying [MNN:Bugfix] fix compile bug for c++ < 14
2d7a44484 xiaying [MNN:Bugfix] fix compile bug for c++ < 14
eb7d0cb53 xiaying [Test:Bugfix] Don't test for NC4HW4 directly
7b40ca8d1 xiaying [MNN:Bugfix] Fix bug for ConvolutionGroup
2694d8a91 xiaying [MNN:Bugfix] Fix bug for CPUGridSample
f89af60f6 xiaying [MNN:Bugfix] Fix compile bug for arm
a151abcdd xiaying [MNN:Bugfix] Fix bug for convert for int8 / int16
b254dbe61 雁行 [MNN:Bugfix] Bugfix for Conv onClone.
d08150631 xiaying [MNN:Bugfix] Fix bug for fast rcnn
e5568a0df xiaying [MNN:Bugfix] Fix bug for CPURaster treat NC4HW4 fast blit
128318933 雁行 [Raster:Bugfix] bugfix for Raster merge onResize.
03caacbea xiaying [MNN:Bugfix] fix bug for CPUDeconvolution and Convolution1x1Strassen for iw != ow
e1e3c245c xiaying [MNN:Bugfix] Fix bug for ConvolutionWinograd
2524cbc6d xiaying [MNN:Bugfix] Fix bug for CPUSoftmax
44ec79b8f xiaying [MNN:Bugfix] Fix bug for CPUConvolutionDepthwise / Scale / DeconvolutionDW
21ae956ce xiaying [MNN:Bugfix] Fix bug for Multi-Batch-TiledExecutor
09a5069c7 xiaying [MNN:Speed] Add offset for src and dst
6776c6784 xiaying [MNN:Bugfix] Fix bug for trainable model
cc83ae30b xiaying [MNN:Bugfix] Fix bug for trainable model
2021-07-29 11:46:59 +08:00
|
|
|
CONVERT(DataType_DT_HALF, halide_type_of<float>(), dataType);
|
2023-12-04 11:12:20 +08:00
|
|
|
CONVERT(DataType_DT_BFLOAT16, halide_type_t(halide_type_bfloat, 16), dataType);
|
2019-12-27 22:16:57 +08:00
|
|
|
return halide_type_of<float>();
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
}
|
2019-12-27 22:16:57 +08:00
|
|
|
Express::Dimensionformat Utils::revertFormat(int format) {
|
|
|
|
CONVERT(MNN_DATA_FORMAT_NCHW, Express::NCHW, format);
|
|
|
|
CONVERT(MNN_DATA_FORMAT_NHWC, Express::NHWC, format);
|
|
|
|
CONVERT(MNN_DATA_FORMAT_NC4HW4, Express::NC4HW4, format);
|
|
|
|
return NCHW;
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
}
|
|
|
|
void Utils::copyInfoToTensor(Tensor* dest, const Variable::Info* source) {
|
- build:
- unify schema building in core and converter;
- add more build script for android;
- add linux build script for python;
- ops impl:
- add floor mod support in binary;
- use eltwise impl in add/max/sub/mul binary for optimization;
- remove fake double support in cast;
- fix 5d support for concat;
- add adjX and adjY support for batch matmul;
- optimize conv2d back prop filter;
- add pad mode support for conv3d;
- fix bug in conv2d & conv depthwise with very small feature map;
- optimize binary without broacast;
- add data types support for gather;
- add gather ND support;
- use uint8 data type in gather v2;
- add transpose support for matmul;
- add matrix band part;
- add dim != 4 support for padding, reshape & tensor convert;
- add pad type support for pool3d;
- make ops based on TensorFlow Lite quantization optional;
- add all & any support for reduction;
- use type in parameter as output type in reduction;
- add int support for unary;
- add variable weight support for conv2d;
- fix conv2d depthwise weights initialization;
- fix type support for transpose;
- fix grad outputs count for reduce grad and reshape grad;
- fix priorbox & detection output;
- fix metal softmax error;
- python:
- add runSessionWithCallBackInfo interface;
- add max nodes limit (1400) for visualization tool;
- fix save error in python3;
- align default dim;
- convert:
- add extra design for optimization;
- add more post converting optimizers;
- add caffe v1 weights blob support;
- add cast, unary, conv transpose support for onnx model;
- optimize batchnorm, conv with variable weights, prelu, reshape, slice, upsample for onnx model;
- add cos/sin/atan/tan support for unary for tensorflow model;
- add any/all support for reduction for tensorflow model;
- add elu, conv3d, pool3d support for tensorflow model;
- optimize argmax, batchnorm, concat, batch to space, conv with variable weights, prelu, slice for tensorflow model;
- others:
- fix size computer lock;
- fix thread pool deadlock;
- add express & parameters in express;
- rewrite blitter chooser without static map;
- add tests for expr;
2019-10-29 13:37:26 +08:00
|
|
|
if (nullptr == source) {
|
|
|
|
dest->buffer().dimensions = 0;
|
|
|
|
return;
|
|
|
|
}
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
for (int i = 0; i < source->dim.size(); ++i) {
|
|
|
|
dest->setLength(i, source->dim[i]);
|
|
|
|
}
|
|
|
|
dest->buffer().dimensions = (int)source->dim.size();
|
|
|
|
dest->buffer().type = source->type;
|
2019-12-27 22:16:57 +08:00
|
|
|
TensorUtils::getDescribe(dest)->dimensionFormat = (MNN_DATA_FORMAT)Utils::convertFormat(source->order);
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
TensorUtils::setLinearLayout(dest);
|
|
|
|
}
|
|
|
|
void Utils::copyTensorToInfo(Variable::Info* shape, const Tensor* tensor) {
|
|
|
|
shape->type = tensor->getType();
|
|
|
|
shape->dim = tensor->shape();
|
|
|
|
shape->size = tensor->elementSize();
|
2019-12-27 22:16:57 +08:00
|
|
|
shape->order = Utils::revertFormat(TensorUtils::getDescribe(tensor)->dimensionFormat);
|
2020-11-05 16:41:56 +08:00
|
|
|
}
|
|
|
|
bool Utils::allocMemoryForHostTensor(Tensor* dest) {
|
|
|
|
if (nullptr != dest->buffer().host) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (TensorUtils::getDescribe(dest)->memoryType != Tensor::InsideDescribe::MEMORY_HOST) {
|
|
|
|
return false;
|
|
|
|
}
|
2024-02-29 16:21:40 +08:00
|
|
|
auto size = dest->usize();
|
2020-11-05 16:41:56 +08:00
|
|
|
dest->buffer().host = (uint8_t*)MNNMemoryAllocAlign(size, MNN_MEMORY_ALIGN_DEFAULT);
|
|
|
|
return dest->buffer().host != nullptr;
|
|
|
|
}
|
|
|
|
bool Utils::releaseMemoryForHostTensor(Tensor* dest) {
|
|
|
|
if (nullptr == dest->buffer().host) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (TensorUtils::getDescribe(dest)->memoryType != Tensor::InsideDescribe::MEMORY_HOST) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
MNNMemoryFreeAlign(dest->buffer().host);
|
|
|
|
dest->buffer().host = nullptr;
|
|
|
|
return true;
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
}
|
2022-07-22 09:59:30 +08:00
|
|
|
Tensor* Utils::getTensor(VARP var) {
|
2022-12-30 15:18:58 +08:00
|
|
|
return (Tensor*)(var->getTensor());
|
|
|
|
}
|
|
|
|
EXPRP Utils::makeRaster(const std::vector<VARP>& vars, const std::vector<int>& regions, const std::vector<int>& shape, halide_type_t dataType, MNN_DATA_FORMAT format) {
|
|
|
|
std::unique_ptr<MNN::OpT> op(new MNN::OpT);
|
|
|
|
op->type = OpType_Raster;
|
|
|
|
auto extra = new ExtraT;
|
|
|
|
// set shape
|
|
|
|
std::unique_ptr<AttributeT> shapeAttr(new AttributeT);
|
|
|
|
shapeAttr->key = "shape";
|
|
|
|
shapeAttr->list.reset(new ListValueT);
|
|
|
|
shapeAttr->list->i = shape;
|
|
|
|
extra->attr.push_back(std::move(shapeAttr));
|
|
|
|
// set region
|
|
|
|
std::unique_ptr<AttributeT> regionAttr(new AttributeT);
|
|
|
|
regionAttr->key = "region";
|
|
|
|
regionAttr->list.reset(new ListValueT);
|
|
|
|
regionAttr->list->i = regions;
|
|
|
|
extra->attr.push_back(std::move(regionAttr));
|
|
|
|
// set data type
|
|
|
|
if (format != MNN_DATA_FORMAT_UNKNOWN) {
|
|
|
|
{
|
|
|
|
std::unique_ptr<AttributeT> attr(new AttributeT);
|
|
|
|
attr->key = "code";
|
|
|
|
attr->i = dataType.code;
|
|
|
|
extra->attr.push_back(std::move(attr));
|
|
|
|
}
|
|
|
|
{
|
|
|
|
std::unique_ptr<AttributeT> attr(new AttributeT);
|
|
|
|
attr->key = "bits";
|
|
|
|
attr->i = dataType.bits;
|
|
|
|
extra->attr.push_back(std::move(attr));
|
|
|
|
}
|
|
|
|
{
|
|
|
|
std::unique_ptr<AttributeT> attr(new AttributeT);
|
|
|
|
attr->key = "format";
|
|
|
|
attr->i = (int)format;
|
|
|
|
extra->attr.push_back(std::move(attr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
op->main.type = OpParameter_Extra;
|
|
|
|
op->main.value = extra;
|
|
|
|
auto expr = Expr::create(std::move(op), vars);
|
|
|
|
return expr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void* Executor::ComputeCache::mapOutput(int offset, Tensor* dest) {
|
|
|
|
auto tensor = mSession->getTensor(offset);
|
|
|
|
auto des = TensorUtils::getDescribe(tensor);
|
|
|
|
if (0 == tensor->deviceId() && des->quantAttr.get() == nullptr) {
|
|
|
|
auto ptr = tensor->host<void>();
|
|
|
|
Utils::releaseMemoryForHostTensor(dest);
|
|
|
|
TensorUtils::getDescribe(dest)->memoryType = Tensor::InsideDescribe::MEMORY_BACKEND;
|
|
|
|
dest->buffer().host = (uint8_t*)ptr;
|
|
|
|
//MNN_ASSERT(nullptr != ptr);
|
|
|
|
return ptr;
|
|
|
|
}
|
2024-06-03 20:09:34 +08:00
|
|
|
if (0 == tensor->usize()) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2022-12-30 15:18:58 +08:00
|
|
|
Utils::allocMemoryForHostTensor(dest);
|
|
|
|
tensor->copyToHostTensor(dest);
|
|
|
|
MNN_ASSERT(nullptr != dest->host<void>());
|
|
|
|
return dest->host<void>();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Executor::ComputeCache::setShapeDirty() {
|
|
|
|
mShapeDirty = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Executor::ComputeCache::setContentDirty() {
|
|
|
|
mContentDirty = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Executor::ComputeCache::~ComputeCache() {
|
|
|
|
mSession = nullptr;
|
|
|
|
#ifdef MNN_EXPRESS_MEMLEAK_DEBUG
|
|
|
|
gInstanceCount--;
|
|
|
|
FUNC_PRINT(gInstanceCount);
|
|
|
|
#endif
|
|
|
|
}
|
2025-07-23 14:10:58 +08:00
|
|
|
Executor::RuntimeExecuteWrap::RuntimeExecuteWrap(const RuntimeInfo& info) : mRt(info) {
|
|
|
|
for (auto& iter : mRt.first) {
|
|
|
|
iter.second->onConcurrencyBegin();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Executor::RuntimeExecuteWrap::~RuntimeExecuteWrap() {
|
|
|
|
for (auto& iter : mRt.first) {
|
|
|
|
iter.second->onConcurrencyEnd();
|
|
|
|
}
|
|
|
|
}
|
2022-12-30 15:18:58 +08:00
|
|
|
ErrorCode Executor::ComputeCache::compute() {
|
|
|
|
std::stack<ComputeCache*> dfsStack;
|
|
|
|
std::set<ComputeCache*> visited;
|
|
|
|
dfsStack.push(this);
|
2025-07-23 14:10:58 +08:00
|
|
|
auto hasUnvisitInput = [&] (ComputeCache* cache) {
|
|
|
|
for (auto c : cache->mInputs) {
|
|
|
|
if (visited.find(c.get()) == visited.end()) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
// Check need compute or not
|
2022-12-30 15:18:58 +08:00
|
|
|
while (!dfsStack.empty()) {
|
|
|
|
auto cache = dfsStack.top();
|
2025-07-23 14:10:58 +08:00
|
|
|
dfsStack.pop();
|
2022-12-30 15:18:58 +08:00
|
|
|
for (auto& c : cache->mInputInside) {
|
|
|
|
if (c->mContentDirty) {
|
|
|
|
return CALL_BACK_STOP;
|
|
|
|
}
|
|
|
|
}
|
2025-07-23 14:10:58 +08:00
|
|
|
if (hasUnvisitInput(cache)) {
|
|
|
|
for (auto c : cache->mInputs) {
|
|
|
|
dfsStack.push(c.get());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Compute
|
|
|
|
visited.clear();
|
|
|
|
dfsStack.push(this);
|
|
|
|
ErrorCode code = NO_ERROR;
|
|
|
|
auto glo = ExecutorScope::Current();
|
|
|
|
RuntimeExecuteWrap wrap(glo->mRuntimeInfo);
|
|
|
|
auto debug = glo->getDebugTools();
|
|
|
|
while (!dfsStack.empty()) {
|
|
|
|
auto cache = dfsStack.top();
|
2022-12-30 15:18:58 +08:00
|
|
|
if (cache->mShapeDirty) {
|
|
|
|
auto code = cache->resize();
|
|
|
|
if (NO_ERROR != code) {
|
|
|
|
cache->mShapeDirty = true;
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!cache->mContentDirty) {
|
|
|
|
visited.insert(cache);
|
|
|
|
dfsStack.pop();
|
|
|
|
continue;
|
|
|
|
}
|
2025-07-23 14:10:58 +08:00
|
|
|
if (hasUnvisitInput(cache)) {
|
2022-12-30 15:18:58 +08:00
|
|
|
for (auto c : cache->mInputs) {
|
|
|
|
dfsStack.push(c.get());
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
visited.insert(cache);
|
|
|
|
dfsStack.pop();
|
2024-06-03 20:09:34 +08:00
|
|
|
if (debug->after != nullptr && debug->before != nullptr) {
|
2024-06-04 11:54:03 +08:00
|
|
|
code = cache->mSession->runWithCallBack(debug->before, debug->after);
|
2024-06-03 20:09:34 +08:00
|
|
|
} else {
|
2024-06-04 11:54:03 +08:00
|
|
|
code = cache->mSession->run();
|
2024-06-03 20:09:34 +08:00
|
|
|
}
|
|
|
|
if (NO_ERROR != code) {
|
|
|
|
return code;
|
|
|
|
}
|
2022-12-30 15:18:58 +08:00
|
|
|
cache->mContentDirty = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NO_ERROR;
|
|
|
|
}
|
|
|
|
ErrorCode Executor::ComputeCache::resizeImpl() {
|
|
|
|
mShapeDirty = false;
|
|
|
|
mSession->setNeedResize();
|
|
|
|
mSession->resize();
|
|
|
|
mContentDirty = true;
|
|
|
|
return NO_ERROR;
|
|
|
|
}
|
|
|
|
ErrorCode Executor::ComputeCache::resize() {
|
|
|
|
std::stack<ComputeCache*> dfsStack;
|
|
|
|
std::set<ComputeCache*> visited;
|
|
|
|
dfsStack.push(this);
|
|
|
|
while (!dfsStack.empty()) {
|
|
|
|
auto cache = dfsStack.top();
|
|
|
|
if (!cache->mShapeDirty) {
|
|
|
|
visited.insert(cache);
|
|
|
|
dfsStack.pop();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
for (auto& c : cache->mInputInside) {
|
|
|
|
if (c->mInfoDirty) {
|
|
|
|
return CALL_BACK_STOP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
auto hasUnvisitInput = [&] () {
|
|
|
|
for (auto c : cache->mInputs) {
|
|
|
|
if (visited.find(c.get()) == visited.end()) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
if (hasUnvisitInput()) {
|
|
|
|
for (auto c : cache->mInputs) {
|
|
|
|
dfsStack.push(c.get());
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
visited.insert(cache);
|
|
|
|
dfsStack.pop();
|
|
|
|
auto code = cache->resizeImpl();
|
|
|
|
if (code != NO_ERROR) {
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
}
|
2022-07-22 09:59:30 +08:00
|
|
|
}
|
2022-12-30 15:18:58 +08:00
|
|
|
return NO_ERROR;
|
2022-07-22 09:59:30 +08:00
|
|
|
}
|
2022-12-30 15:18:58 +08:00
|
|
|
#ifdef MNN_EXPRESS_MEMLEAK_DEBUG
|
|
|
|
int Executor::ComputeCache::gInstanceCount = 0;
|
|
|
|
#endif
|
2022-07-22 09:59:30 +08:00
|
|
|
|
2019-12-27 22:16:57 +08:00
|
|
|
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
} // namespace Express
|
|
|
|
} // namespace MNN
|