Граф коммитов

418 Коммитов

Автор SHA1 Сообщение Дата
Neo Chien dee52466db Implementation of tile for TFLite (#3814) 2019-08-31 18:56:39 -07:00
Haichen Shen eef35a57d9 [Relay][Any] Add shape func for dynamic shape (#3606)
* init shape func in interpreter and vm compiler

* Update interpreter

* fix

* lint

* lint

* fix

* remove hack

* update

* fix

* fix

* update

* address comments & update for shape_of

* fix lint

* update

* fix hybrid

* lint

* fix bug & add take shape func

* lint

* lint

* update

* fix flaky test

* add todo
2019-08-31 18:50:22 -07:00
Josh Fromm d08c74caf6 [Relay] Bitserial ops (#3844)
* Added arm_cpu NHWC schedules.

* Fixed kernel shape legalization.

* Added bitserial ops to relay.

* Snapshot and more missing files.

* Added dense testing.

* Added tests

* Added ASF header to new files.

* cc lint

* Pylint change.

* pylint fixes.

* Change arm legalize test.

* Added assert check to arm legalize.

* Added better documentation, fixed some bad style

* Reverted arm conv2d nhwc changes.
2019-08-31 17:51:51 -07:00
Neo Chien 73dc5ac379 Add not operator for the frontend/onnx.py (#3836) 2019-08-31 17:50:36 -07:00
SWu a711f38ebe Improve numerical gradient check (#3856) 2019-08-31 02:25:16 -04:00
Alexander Pivovarov 2ebf1bd14e Add more cases to keras _convert_reshape (#3846) 2019-08-30 21:30:59 -07:00
Animesh Jain ec7790e355 [QNN] Concat - Refactoring to C++ (#3819) 2019-08-30 21:30:18 -07:00
Animesh Jain 671421a805 [Relay][QNN] QNNtoRelay & QNNLegalize Pass utility using Relay Legalize API. (#3838) 2019-08-30 09:10:25 -07:00
Wuwei Lin d201978415
[Relay] Conv2d grad (#3636)
* [Relay] Conv2d grad

* Fix test

* Fix first order gradient
2019-08-29 13:36:06 -04:00
lixiaoquan ce031438a7 [TensorFlow] Fix limitation that depth_mult can only be 1 for DepthwiseConv2dNative (#3676)
* [TensorFlow] Fix limitation that depth_mult can only be 1 for DepthwiseConv2dNative

* Improve code readability
2019-08-29 10:59:06 +08:00
Yong Wu 19b8b3a4e9 [Relay][Keras] Dot (#3668)
* [Relay][Keras] Dot

* fix reshape

* fix comments
2019-08-28 15:16:48 +09:00
Yong Wu 07a83a669f [Bugfix][Keras] axis of softmax (#3834) 2019-08-27 19:15:51 -07:00
Neo Chien 70f0a16938 Fix code comment of operators (#3830) 2019-08-24 13:32:55 -07:00
Animesh Jain 1e4aea8187 [Legalize][QNN] Pass out_types to Legalize. Update QNN requantize to read from out_types. (#3782) 2019-08-23 12:50:00 +08:00
雾雨魔理沙 ea6814ad58 [Relay] Fix typo in parser (#3785) 2019-08-22 23:16:15 -04:00
Jon Soifer 554df21189 [TOPI][Relay][TensorFlow] Add OneHot operator (#3781)
* Add one-hot to Relay

* topi implementation

* Working

* add topi test

* Add TF test

* Fix check

* fix linting issues

* fix documentation

* Fix documentation

* Add support for on_value, off_value, axis, dtype

* Add full support for axis

* Fix compute and update test_forward

* Move on_value and off_value to inputs

* Add topi test

* Update tests

* Update docs

* Fix style

* re-enable tests

* Add one_hot to mxnet converter
2019-08-22 13:45:45 -07:00
Josh Fromm 7264cb6a59 Changed topi cc resize to python implementation with new features. (#3788) 2019-08-22 12:39:09 +09:00
Jon Soifer c870261fac [TOPI] Use cblas for dense and batch_matmul when "cblas" is in the target libraries (#3787)
* Support cblas library in dense

* start to add support for generic batch_matmul compute

* Add x86 override for batch_matmul

* Fix linting

* reset file

* Fix typos

* dummy change to re-trigger CI
2019-08-20 22:24:09 -07:00
Wei Chen 95f12e3137 [Relay][VM]VM Profiler (#3727)
* [Relay][VM]VM debugger

* Report mean/min/max for op duration

* Typos

* Lint

* Lint

* Lint

* Support build debug VM in CMake

* Lint

* Enable VM debug in unit test

* Disable debug vm test until new docker image is built

* Add device sync code

* Fix qnn unit test

* Disable vm debug by default

* Rename files

* Rename classes

* Fix comment

* Fix comment
2019-08-20 21:28:05 -07:00
Zhao Wu ebda258924 [CI] Solve occasional CI issue when pad value is all 0 (#3801) 2019-08-20 05:50:49 +08:00
Neo Chien 3c8901ad0b [Relay][Frontend][TFLite] transpose implementation for tflite.py (#3705)
* transpose implementation for tflite.py

* add TRANSPOSE to convert_map

* Fix Unexpected keyword argument 'axis' in function call

* add test for transpose oprator

* Add the parameter 'axes' handling

* add test for transpose oprator

* solve conflict within CONTRIBUTORS.md

* Improve the if condition for empty tuple

* Add one unit test to cover empty tuple

* solve conflict within CONTRIBUTORS.md
2019-08-19 10:20:38 -07:00
Zhao Wu cb22d50ae4 [CoreML] Solve CoreML frontend issue of image scaler and padding so that Mobilenet mlmodel can work correctly. (#3800) 2019-08-19 14:05:41 +08:00
ziheng b76b627b61
[BUGFIX] Fix for NoneType Target (#3792) 2019-08-16 13:14:29 -07:00
shoubhik d3eb9cb84b QNN quantize and dequantize operators. (#3745)
* QNN quantize and dequantize operators.

* addressing review comments.

* addressing review comments.

* Adding new line at the end of the file.

* Adhering to styling guidelines.

* Adding name to contributors.

* Fixing lint issue.

* Fixing file name.

* Removing unnecessary code.
2019-08-15 20:29:34 -07:00
Jon Soifer 674feba0dc [Relay][Frontend][ONNX] Add Sign and Equal operators to ONNX frontend (#3760)
* [Relay][Frontend][ONNX] Add Sign and Equal operators to ONNX frontend

* Dummy change to retrigger integration test
2019-08-15 11:41:54 -07:00
ziheng 7eb1f353de
[QUANTIZE] Refactor quantization codebase and fix model accuracy (#3543)
* Refactor.

* update

* update

* update

* update

* update

* update
2019-08-15 02:31:30 -07:00
Animesh Jain 60fc9f7476 [QNN] InferType changes that missed CI. (#3779) 2019-08-14 23:35:15 -07:00
Animesh Jain f06ef4f2ae [QNN] Concatenate operator (#3730) 2019-08-14 16:56:58 -07:00
Animesh Jain 5498e54de8 [Relay][Legalize][ARM_CPU] Handling NHWC layout for arm_cpu. (#3754) 2019-08-14 16:44:13 -07:00
雾雨魔理沙 ae1ba36df8 fix (#3769) 2019-08-13 22:31:18 -07:00
Jon Soifer 83bef9fff2 [Relay][Frontend][TensorFlow] Support BatchMatMul with input dimensions larger than 3 (#3732)
* Support BatchMatMul with shapes greater than length 3

* Fixes

* Add tests

* Remove dependency on Python3

* Clean up

* Merge with master

* Resolve comments
2019-08-13 17:15:45 -07:00
Zhi 8a46444ffe fix some pass docs (#3767) 2019-08-13 15:23:50 -07:00
Josh Fromm 8bd9d4d5ed [Relay] SpaceToDepth and MirrorPad Operators (#3718)
* Added relay and topi mirror_pad operator.

* Added mirror_padding to tensorflow frontend.

* Added mirrorpad testing in tensorflow frontent.

* Added space_to_depth in tf frontend.

* Added tests for spacetodepth.

* spacetodepth bug fix.

* Lint fix

* Added mirror pad python attrs.

* Pad code formatting.

* Syntax improvement

* Hopefully last lint fix
2019-08-12 17:48:10 -07:00
雾雨魔理沙 52fde8f773 [Relay] [Training] Fix ad for concatenate (#3729)
* reproduce error

* fix

* lint

* lint
2019-08-09 12:40:16 -07:00
Animesh Jain a78adbd53a [QNN] Requantize operator (#3531)
* [Relay] [Quantization] WIP - Common files for the qauntization work.

* [Relay] [Quantization] WIP - Prototyping requantize op.

* Requantize operator implementation.

Requantize converts one quantized tensor representation to another quantized
representation. The PR has following implementation features

- Requantize operator defined in qnn namespace - relay.qnn.requantize
- Lowering of the requantize to exisiting Relay operators
- Integer fixed point implementation of requantize
    - Two rounding modes - FE_UPWARDS (round towards infinity) and
    FE_AWAY_FROM_ZERO (std::round behavior)
- Floating point implementation as well, that can act as reference or can be
used for devices when FP32 computation is not used.
- Unit test cases

Relevant Issue - https://github.com/dmlc/tvm/issues/2351

Credit to TFLite and GemmLowp to provide reference implementations.

* Typo and lint fixes.

* Doc fix.

* Uncommenting the lint script (fixing mistake).

* Modifying the unit tests.

* Moving C++ files into src/relay/qnn

* Moving python files to python/tvm/relay/qnn. Some minor fixes.

* Moving the attrs.h inside the include directory.

* Pushing files that I forgot earlier. Changing util location.

* Incorporating comments. API change. Lint fixes.

* Modifying the GetFixedPointMultiplierShift API as per comments.

* Forgot the dialect change.

* Changing rewrite to qnn_lower.

* Renaming Quantize to Qnn for clarity.

* Remove use_int_domain.

* Incorportaing review comments.

* Adding API doc for QNN dialect.

* Move the qnn_lower pass to transform namespace.

* Moving from expr to module. Adding namespace in C++.

* Minor sentence rewrites. Added qnn namespace.

* Added the API doc.

* Chanding default out_dtype to int8. Adding a test with in/out_dtype as uint8.

* Style fixes. Better error messages.

* Adding documentation.

* More documentation fixes.

* Adding out dtype check for requantize.

* Adding corner case for FP32 to fixed point conversion.

* Adding extra line.

* Documentation fix.

* Adding static inline.

* Incorporating jackwish comment. Removed idtype from requantize lowering.

* Removing Quantize/Dequantize code. Restricting Requantize to (u)int8/int32.

* Style fixes.

* Fix the docs.

* Move to Legalize API.
2019-08-08 11:41:24 -07:00
Haichen Shen 6b6e3888ca [Relay/TOPI][Op] Add variance and layer norm op (#3700)
* Add LayerNorm op

* update

* fix

* Add mean_std and mean_variance

* add std and update doc

* add license

* x

* lint

* x

* fix

* fix doc
2019-08-07 20:34:53 +09:00
Haichen Shen f9e8c11693 [Frontend][MXNet] Fix mxnet converter for hybridblock and add div_sqrt_dim (#3701)
* Fix mxnet converter for hybrid block

* tweak

* fix rebase

* fix

* add test
2019-08-06 21:27:06 -07:00
Animesh Jain 79922bd39f [Relay] Legalize pass (#3672)
* [Relay] Rewrite pass.

This pass transforms an expression to other expression.

This pass has many usecases
 * Replace a expr to another expr, if the other expr has faster performance.
 * For ASICs, we might want to modify the inputs to adapt to the HW support.
 * Alter op layout can work in conjunction with this pass.

The supporting usecase is the Intel i8 x i8 conv. Intel HW supports u8 x i8 conv
in HW. Using this pass, we can replace an i8 x i8 conv to a sequence of
operators where one of the operators is now u8 x i8 conv. This will also help
automatic quantizaion performance.

* Better API name.

* Removing the conv2d legalization for x86. Will send a separate PR.

* Test name changes.

* Registering one funtion to register FTVMLegalize.

* Better comments.
2019-08-06 15:23:41 -07:00
Zhi be8fa6ac17 [relay][frontend] clean up tf frontend (#3710)
* clean up tf frontend

* fix get_relay_op
2019-08-06 14:05:06 -07:00
Haichen Shen 43cc89bfaf [Bugfix] Fix the issue that function pass modifies original module (#3712)
* fix

* fix interpreter
2019-08-06 12:25:59 -07:00
Yulun Yao 3b287c4d4e [Relay] [TOPI] `{relay,topi}.nn.sparse_transpose` for **Square** CSR matrices (#3707)
* add build gcn tutorial

* add transpose operator for square sparse matrices

* remove extra files

* change loop tag

* comply with lint

* comply with lint -- line too long

* comply with lint

* lint check

* lint check

* lint check

* apply marisa and theirry's reviews
2019-08-05 18:13:22 -07:00
雾雨魔理沙 c8654e2a2f [Relay] Partial Evaluator do concatenate, and has better termination checker for scalar. (#3703)
* save

lint some

lint

lint

add charrnn

save

save

save

remove debug

remove debug

remove space

refactor

save

rewrite dce

* reset files

* join -> meet

* lint

* address review comment

* wordsmith
2019-08-05 09:23:36 -07:00
Neo Chien f9ba0db362 Align the naming rule for OpAttributeUnImplemented (#3695) 2019-08-02 08:52:00 -07:00
Wuwei Lin 33ab3c6028 [Relay][Quantization] KL-divergence-based per-layer calibration (#3538)
* [Relay][Quantization] Support floating-point scale

* [Relay][Quantization] KL-divergence calibration on dataset

* Fix unhandled LeftShift case in QuantizeRealize

* Fix lint

* drop QBias

* fix lint

* address comments

* address comments

* Update comments

* address comments

* lint

* kQIdentity = 0
2019-08-01 20:55:27 -07:00
Wei Chen 5357f49b0e [Relay][VM] Support execution on devices (#3678)
* [Relay][VM] Support execution on devices

* Reduce Copy calls

* Cleanup

* Lint

* CR comments

* Merge test into test_vm.py
2019-08-01 14:47:11 -07:00
alexgl-github d72cdfa604 Add support for Tensorflow operators log1p, cos, sin (#3614)
The patch adds support for Tensorflow operators log1p and cos
Tensorflow log1p is described at https://www.tensorflow.org/api_docs/python/tf/math/log1p
Tensorflow cos is described at https://www.tensorflow.org/api_docs/python/tf/math/cos
Tensorflow sin is described at https://www.tensorflow.org/api_docs/python/tf/math/sin
2019-08-01 12:46:39 -07:00
雾雨魔理沙 331585f42e [Relay] Strict mode in pattern matching (#3620)
* add fatal

lint

lint

lint

do

make completeness check an error

lint

remove fatal

* fix test

* reset parser file

* remove unneeded import

* Update python/tvm/relay/adt.py

Co-Authored-By: Steven S. Lyubomirsky <slyubomirsky@gmail.com>

* Update include/tvm/relay/adt.h

Co-Authored-By: Steven S. Lyubomirsky <slyubomirsky@gmail.com>

* Eliminate trailing whitespace (my fault)
2019-08-01 11:52:13 -07:00
Yifan Xiong 461e019ea2 [Relay][Frontend] Fix typo names in frontend (#3685)
Fix typo names in caffe2 and onnx frontend:
* sotrage_order -> storage_order
* OpNotInplemented -> OpNotImplemented
2019-08-01 09:46:23 -07:00
Zhi 9045512131 [Relay][VM] Relay VM serialization (#3647)
* relay vm serialization

* fix lint

* load params, fix stream

* lint

* fix typo
2019-07-31 09:02:15 -07:00
雾雨魔理沙 f1d43378d9 [Relay] Fix typo in ChangeBatch (#3660) 2019-07-29 21:58:08 -07:00