Commit Graph

1104 Commits

Author SHA1 Message Date
Minmin Sun (孙敏敏) d64bf6b51b Auto TensorCore CodeGen (#4234)
* Add Auto TensorCore TensorCore Unit Test

* Rebase to tvm master branch & Add auto tensor core

* Code Refine

* Add tensor core switch by pragma

* Add pragma in tensor core example code

* Get real tile size to replace hard coded 16

* support more than 2 dimensions (e.g. batchmatmul) for buffer bind scope

* support batch matmul

* Move cuda env check to tensor_core.cc

* Coderefine for tensor_core.cc

* Refine comments

* Some refinements of code and comment

* Update TensorCore UT to pass the CPU test

* remove redundant code

* matmul's storage align for different layout

* Add support for differenct position of type cast

* Add formal tutorial for auto tensorcore codegen

* move tensorcore check up to tutorial code

* code and doc refine

* comment out tune_and_evaluate in tutorial

* fix cpplint error
2019-11-09 13:01:36 -08:00
Jon Soifer 5bcd3313ee [Relay][Frontend][ONNX] Add support for broadcasting to Where and MatMul (#4267) 2019-11-07 14:10:30 -08:00
Josh Fromm 14a5a35882 [AutoTVM] Add batch_matmul to tunable operations (#4242)
* Batch matmul tuning running but with errors.

* Default x86 schedule as good as before.

* Code Cleanup

* Remove unused argument.

* improved template documentation.

* Silly lint fix

* Removed leftover comment.

* Moved cfg declaration to schedule for batch_matmul

* Moved x86 dense cfg declaration to schedule.

* lint fix

* Removed duplicate cfg declaration in dense.

* Reverted changes to dense.
2019-11-06 16:07:09 -08:00
Neo Chien ddaa953087 [Contrib] Fix error message at callback_get_section_size() (#4221)
* [Contrib] Fix error message at callback_get_section_size()

* Trigger notification
2019-11-06 10:39:40 -08:00
Tianqi Chen 86b844b995 [DOCS] Update link loc (#4257) 2019-11-05 16:03:04 -08:00
zhuochen aae5cde8b9 workaround typing.Deque import error for Python 3.5 (#4254) 2019-11-05 09:51:36 -08:00
Trevor Morris 3f472f94b3 [Relay][Frontend][Tensorflow] Fix GatherV2, Add StopGradient (#4238)
* Add StopGradient. Add batch_dims attr to ignore list for GatherV2

* Trigger CI
2019-11-04 10:37:41 -08:00
Kim 996cf30e8d remove PEP498 f-string new feature for support python3.5 (#4250) 2019-11-04 08:04:02 -08:00
Yao Wang e9039d0452 Support reshape for dynamic shape in tf converter (#4185)
* Support reshape for dynamic shape in tf converter

* Only allow reshape directly after shape function for symbolic input shape

* Fix lint
2019-11-01 20:10:21 -07:00
Jared Roesch 2083513fcd Implement explicit IR representation of memory alloction (#3560) 2019-11-01 14:28:23 -07:00
Wei Chen 19164063aa [Relay][Prelude] Add more dtypes to tensor_t (#4233) 2019-11-01 13:37:58 -07:00
Kim cd717dea4d [ Relay ][ Frontend ][ Tensorflow ]add op add_n to relay/frontend/tensorflow.py (#4181) 2019-11-01 08:54:33 -07:00
KoolKoffee a6221a1f71 Fix typo in get_output doc-string (#4237) 2019-10-31 09:15:57 -07:00
Wei Chen 31b47c84b3 [Relay] Install Relay Prelude program in package install (#4227) 2019-10-30 15:54:56 -07:00
Jon Soifer b07b195264 [Relay][Topi][TensorFlow][ONNX][Lang] Add support for Any op (#4205)
* Add support for Any op

* Support ONNX frontend

* Add doc

* Add to relay docs

* Dummy change to retrigger CI
2019-10-30 11:43:09 -07:00
Josh Fromm 156aa5900a [Relay][Frontend][ONNX] New Operators and Opsets to Support BERT (#4197)
* Added slice v10

* Added constantofshape operation and small refactor.

* Finished one_hot implementation.

* Reshape working across all bert layers.

* Fixed constantofshape and removed code duplication.

* onnx model fully ingested.

* Working on improving onnx tests.

* Changed onnx testing to use onnxruntime instead of caffe2, also formatted.

* Add arbitrary output nodes to onnx frontend.

* Added v6 tiling for bert squad 8 support.

* Small syntax fixes

* Reduced code duplication in split opset versions.

* Added batch matmul test

* Added unstack split testing.

* Adde onehot test, needs a little cleanup probably.

* Replaced deprecated constant fill with constantofshape and updated tests accordingly.

* Added tests for new opset version of slice and tile.

* lint clean up

* Lint fixes

* Changed onnx dependency

* Went back to caffe2 runtime for CI integration.

* Rebase and small typo/syntax changes.

* Added hard casting of onehot attributes to int.
2019-10-30 11:24:47 -07:00
Tianqi Chen 71f39be5a3 [PYTHON] Add __init__ to the generated grammar so that it can be installed properly (#4223) 2019-10-30 11:17:33 -07:00
shoubhik 2be444f905 Improve the lowering of Qnn Dense (#4213)
* [QNN] Improving Dense lowering.

* - Moving get_shape method to util
- Finalizing the test cases and the code structure for optimized dense computation.

* - Fixing cpplint.

* - Addressing review comments.

* - Renaming the variables correctly.

* - Renaming the variables correctly.
2019-10-30 09:12:14 -07:00
Logan Weber 09f0ac3385 [Relay] Add Python type functor and tests (#4209)
* Add Python type functor and tests

* Lint roller
2019-10-29 21:51:20 -07:00
LiangHao 2386e74b03 Optimizing autotvm task extraction speed (#4138)
* Optimize task extraction speed

* correct pylint errors

* Delete unused function

* remove unnecessary argument

* resolve code review comments

* corrent cpp lint errors

* remove one more graph_json return value

* fix test bugs
2019-10-29 11:45:02 -07:00
Wuwei Lin 794db3702b Update have_int8 condition to run on compute capability 7.x devices (#4214) 2019-10-29 21:23:23 +09:00
Wuwei Lin e8899285ea [Relay][Quantize] Use fixed point mulplications (#4160) 2019-10-29 00:51:29 -04:00
Xingyu Zhou 8b1fb4d592 [Relay][Op] Enhance Upsample Operator to support float scales (#4206)
* :add scale2 for upsample

* update unit test for upsampling

* support latest upsample op for multiple frontend

* fix lint

* fix lint

* fix lint

* fix lint

* update scale description and rebase
2019-10-28 11:34:56 -07:00
Logan Weber 319c279ddf Fix type var docs (#4208) 2019-10-28 11:03:32 -04:00
Jon Soifer 07606e4cb4 [Relay][Frontend][ONNX] Add support for op Where (#4184)
* Add support for op Where

* Update impl version
2019-10-26 17:05:22 -07:00
Jared Roesch 9cc7874166 [Relay][Params] Add APIs for storing and retrieving parameters from individual functions. (#4194)
* Add support for attaching params

* Fix types

* Fix test
2019-10-26 17:05:03 -07:00
Altan Haan 93d610a19a [Relay][Training] Add checkpoint annotation for checkpointing memory optimization (#4146)
* add checkpoint annotation for checkpointing memory optimization

* add alpha-equivalence checkpoint test and fix gradient type issue

* fix build issues

* ignore checkpoint annotation when checking missing gradients

* refactor, fix checkpoint compute for tuple and add tests
2019-10-26 17:04:42 -07:00
雾雨魔理沙 1ad6a2af67 [Relay] crossentropy_with_logits and its gradient (#4075)
* save

* lint
2019-10-25 17:54:29 +03:00
Siyuan Feng 324a9607eb TensorCore Support using Intrinsic (#4136)
* add tensor core support

* avoid memory bank conflict

* fix thread sync & better performance

* better performance

* add schedule test for conv2d

* extend into BatchMatMul

* support config fragment shape and layout using intrinsic

* add TensorCore tutorial

* add int support and fix lint

* address comment

* add 32*16*8 TensorCore test

* fix wmma include logic
2019-10-24 12:04:37 -07:00
Cody Hao Yu 4ab73634c1 [TOPI] Tunable Template for Conv2D HWCN on CUDA (#4168)
* support conv2d HWCN in AutoTVM and Relay

* fix lint

* fix comments and unit tests
2019-10-24 12:03:15 -07:00
雾雨魔理沙 2e0dbaa62a [Relay] Fix memory leak in the interpreter (#4155)
* save

lint

* address reviewer comment
2019-10-24 11:50:25 -07:00
Ina Dobreva b08fe81053 Add parser support for SUM tflite operator (#4182) 2019-10-24 09:58:22 -07:00
optima2005 f6a0aa2a55 [Documentation]Fix example code in comment of tvm.build_module.build() (#4195)
* Fix example code in comment of tvm.build_module.build()

* Update build_module.py
2019-10-24 09:56:00 -07:00
Bjarke Hammersholt Roune c147a31dde Add support and testing for tf.assert (as no-op) and tf.no_op to TF Relay frontend. (#4172) 2019-10-23 13:53:03 -07:00
Yizhi Liu 5408d3a3bf [rpc] use callback func to do send & recv (#4147)
* [rpc] use callback func to do send & recv. don't get fd from sock as it is deprecated in java

* fix java build

* fix min/max macro define in windows

* keep the old rpc setup for py

* add doc for CallbackChannel
2019-10-23 11:02:34 -07:00
Jon Soifer 101e3e0850 [Relay][Frontend][TF] Fix Size operator (#4175)
* [Relay][Frontend][TF] Fix Size operator

* Uncomment tests
2019-10-22 16:37:53 -07:00
mbarrett97 ecb0a7eab0 [TOPI] Added support for Mali Bifrost target (#4047) 2019-10-22 13:49:17 -07:00
Cody Hao Yu a21904a57e merge extract_from_program and extract_from_multiple_progam (#4173) 2019-10-22 13:26:04 -07:00
ekalda e5835425ef Add support for quantized multiply to Relay (#4141)
This patch adds multiply operator for quantized tensors.
The details of the quantized multiplication are outlined
in the code.

This builds on pull request 3927 and includes the changes
Animesh mentions in the comments on that request.

Change-Id: I555715b53d0266a91d5c03dc3dfe8fc31e7ce4e1
2019-10-21 07:07:39 -07:00
Tianqi Chen 7895adb243 [REFACTOR][NODE][RUNTIME] Move Node to the new Object protocol. (#4161)
* [REFACTOR][NODE][RUNTIME] Move Node to the new Object protocol.

This PR removes the original node system, and make node as a subclass of Object.
This is a major refactor towards a better unified runtime object system.

List of changes in the refactor:

- We now hide data_ field, use Downcast explicitly to get a sub-class object.
- Removed the node system FFI in python.
- Removed the node C API, instead use PackedFunc for list and get attrs.
- Change relay::Op::set_attr_type_key(attr_key_name) to relay::Op::set_attr_type<AttrType>().
  - This change was necessary because of the new Object registration mechanism.
  - Subsequent changes to the op registrations
  - The change revealed a few previous problems that is now fixed.
- Patched up a few missing node type registration.
  - Now we will raise an error if we register object that is not registered.
- The original node.h and container.h are kept in the same location.
- Calling convention: kObjectHandle now equals the old kNodeHandle, kNodeHandle is removed.
- IRFunctor now dispatches on ObjectRef.
- Update to the new type checking API: is_type, derived_from are replaced by IsInstance.
- Removed .hash member function, instead use C++ convention hasher functors.

* Address review comments
2019-10-20 18:30:41 -07:00
Wei Chen 32aad56c3a [Refactor] Rename Datatype to ADT (#4156)
We think it will reduce the confusion with the meaning.

https://discuss.tvm.ai/t/discuss-consider-rename-vm-datatype/4339
2019-10-19 21:57:50 -07:00
Animesh Jain fdb01cb608 [QNN][TFLite] Parsing QNN Add op. Adding MobilenetV2. (#4142) 2019-10-18 10:51:15 -07:00
Wei Chen 36a96773bc [Relay][Frontend][TF] Add tensor array ops (#3798)
* [Relay][Frontend][TF] Add tensor array ops

* rename

* delete test

* Move utility function

* Refactor

* fix tensor array ops

* fix test

* fix rebase

* Fix serializer bug

* Improve tf convert name lookup to use prelude api

* Fix lint

* Fix test
2019-10-17 22:41:34 -07:00
Zhi 4052de6d1c [relay][vm] Separate VM runtime with executable (#4100)
* [relay][vm] Separate VM runtime with executable

* Address comments

* move ctx back to vm

* make only vm related fields and methods protected

* integrate seriliaztion/deserialization to executable

* create stream
2019-10-17 13:25:08 -07:00
Animesh Jain 972f019c73 [TOPI][x86] Cascade lake support. (#4123)
* [TOPI][x86] Cascade lake support.

* Jenkins test debug 1.

* Testing cascade lake alone.
2019-10-17 09:31:58 -07:00
Tianqi Chen 02c1e11716 [RUNTIME] Refactor object python FFI to new protocol. (#4128)
* [RUNTIME] Refactor object python FFI to new protocol.

This is a pre-req to bring the Node system under object protocol.
Most of the code reflects the current code in the Node system.

- Use new instead of init so subclass can define their own constructors
- Allow register via name, besides type idnex
- Introduce necessary runtime C API functions
- Refactored Tensor and Datatype to directly use constructor.

* address review comments
2019-10-16 15:24:23 -07:00
Altan Haan 46fa6eebcd [Relay][Training] Add and fix gradients (#4126)
* add and fix gradients

* fix linter issues
2019-10-16 10:32:29 -04:00
Animesh Jain 1c0e7435cc [QNN] Change default rouning to UPWARD. (#4131) 2019-10-15 22:17:47 -07:00
Tianqi Chen a0bd3786ed [RFC][RUNTIME] Introduce new object protocol. (#4115)
* [RUNTIME] Introduce new object protocol.

This PR introduces a new object protocol to unify the node and object.
We also updated the existing runtime::vm code to make use of the new system.

Update to the node will be done in a follow up PR.

Other changes:

- Remove object related code in json serializer as that code logic was not complete
  and we have a separate serializer for VM, can revisit later.

* address review  comment

* Fix the child slot logic
2019-10-14 22:46:35 -07:00
Animesh Jain bfb811c72c [QNN][TFLite] Parsing TFLite quantized models. (#3900) 2019-10-14 12:34:09 -07:00