Commit Graph

4363 Commits

Author SHA1 Message Date
Samuel e2fb5039a2 [TOPI][RELAY][PYTORCH]Conv3d_transpose op support added (#5737)
* [TOPI][RELAY][PYTORCH]Conv3d_transpose op support added

* Test cases in topi/relay

* conv3d_transpose_ncdhw_python added

* Review comments fixed
2020-06-11 18:12:35 +09:00
Haichen Shen c7274fd3b0 [Relay] Fix for recursive let (#5757)
* Make let processing iterative

* Try again

* Fix pretty printer overflow

* cleanup

* fix lint

* Fix text printer

Co-authored-by: Jared Roesch <roeschinc@gmail.com>
Co-authored-by: Jared Roesch <jroesch@octoml.ai>
2020-06-10 20:49:57 -07:00
Zijing Gu ed583092db [topi] block sparse dense on cuda (#5746) 2020-06-10 13:07:36 -04:00
Jared Roesch 60cfb79ce7 [Rust] Second stage of Rust Refactor (#5527)
* Add tvm-rt crate

* Backport changes from frontend branch

* Format

* Add ASF headers

* Address self-code review

* Replace with helper

* Fix lint

* Fix

* Clean up repro debugging

* WIP

* Remove global resgistry to fix one memory issue

* Fix

* Format

* Format

* Update rust/tvm-rt/README.md

Co-authored-by: Jason Knight <binarybana@gmail.com>

* Format

* Duplicate TVM macros

* Split macros

* Restore old macro for old crates

* Repair macros

* Fix format

* Format

Co-authored-by: Jason Knight <binarybana@gmail.com>
2020-06-10 02:07:19 -07:00
Tianqi Chen 10bff2717e [REFACTOR][TIR] Provide->ProducerStore, Realize->ProducerRealize. (#5750)
This PR finishes up the final step for DSL/TIR de-coupling to refactor
Provide/Realize to use the DataProducer.

As in the case of ProducerLoad, ProducerStore/Realize are not supposed
to appear in a vaid TIR function ans are only used by high-level DSLs
as intermediate structures.
2020-06-09 22:28:52 -07:00
Cody Yu 54641ec26e [Bugfix] Fix reshape (#5739)
* Fix reshape

* fix doc warning

* fix ci

* address comments
2020-06-09 22:03:09 -07:00
Junru Shao e0e03a1fbd [Minor][Test] Clean WASM environment before build (#5759) 2020-06-09 17:32:38 -07:00
Matthew Brookhart 9f79199822 Add Scatter to Topi/Relay/ONNX via hybrid script (#5619)
* I can construct scatter but not embed it in a Relay Graph

* working 1-4 dimesion scatter

* add scatter to ONNX

fix lint

* isolate tests to cpu backend

* Fix i386 test

* fix gpu tolerance

* use elemwise_shape_func for scatter

* fix incorrect rebase
2020-06-10 07:33:57 +09:00
Yong Wu aa808570db [TOPI][Relay][OP] support dynamic NMS(Non Maximum Suppression), symbolic begin, end, and strides for strided_slice (#4312)
* [TOPI][Relay][OP] Dynamic NMS and strided_slice

* Incorporate comments

* fix nnvm compatibility issues

* fix InferCorrectLayout

* Minor fix

* fix for fuse

* Workaround to pass batch_size into hybrid function to handle dynamic shape

* Seperate rearrange

* fix lint

* fix ci, comments

* change attr to Optional<T>

* clang format

* remove empty lines

* partial ignore for end of strided_slice

* pylint

* add out_indices for gpu get_valid_counts

* change to slice_mode

* clang-format, fix comments

* fix comment

* change slice_mode to string

* fix CI

* update docstring

Co-authored-by: Yao Wang <kevinthesunwy@gmail.com>
2020-06-09 09:48:33 -07:00
xqdan 0ea99698f4 [ARITH][BACKPORT-0.6] fix a min/max simplify bug (#5749)
* fix a min/max simplify bug

* fix cpplint

* turn into oposite when c1val<0 and add more case

* fix c1=0

Co-authored-by: xqdan <danxiaoqiang@huawei.com>
2020-06-09 08:34:27 -07:00
Trevor Morris 2e1ef8e4b7 Don't add cast for TF batch norm when type isn't changing (#5731) 2020-06-09 05:13:28 +05:30
Tianqi Chen 6ae439c8c5 [REFACTOR][TE][TIR] Call::Halide => ProducerLoad, DSL/TIR decouple. (#5743)
In the HalideIR's design, DSL components and IR are mixed together.
For example, Call::Halide can containa reference to a function which is
constructed in the tensor expression language.

While this coupled design simplifies certain aspect of the DSL construction,
it prevents the TIR to evolve as a clean standalone IR:

- The additional tensor expression provided in the function is opaque to the IR
  and may become obsolete as we transform them.
- The duplication of the information in the DSL tensor and IR makes it hard to
  design a stand-alone text format (when there are elements shared in the tensor
  expression and normal statements).

This PR aims to clearly de-couple the TIR from high-level DSL structures(tensor expression),
while still provide clear extensions to build DSLs on top of the TIR.

We introduce a DataProducer as a base class for high level tensor expressions objects
that produce data. We then introduce ProducerLoad to replace the Call::Halide usage,
so that the Call node can always be self contained and used for low-level calls.

The high-level tensor expression DSL can still generate a PrimExpr that contains a ProducerLoad.
These PrimExprs contains fragments of information that can be combined together to
generate a low-level TIR PrimFunc.

We also state clearly that DataProducer **should not** appear in any TIR PrimFunc.
Instead, the high-level DSL layer should lowered DataProducers to Buffers and TIR statements
that produces these buffers. We can further provide verifications to validate such invariance.

Changes:
- Introduce DataProducer to serve as a base class for Tensor in tensor expressions.
- Migrate use of Call::Halide to ProducerLoad
- Migrate the other usages of Calls.

We will also create follow-up PRs to migrate the remaining two DSL related IR nodes(Realize/Provide)
to use the DataProducer.
2020-06-07 14:11:05 -07:00
Zhi 7053546a9a sequential cpp test (#5745) 2020-06-07 12:41:23 -07:00
Junru Shao aa23e72651 Add some docs on downstream consistency (#5742)
https://github.com/apache/incubator-tvm/pull/5730#issuecomment-639567636
2020-06-06 15:23:20 -07:00
Tianqi Chen a643eb7b42 [REFACTOR][ARITH] Remove legacy compute_expr.h (#5738)
Replaces most of the ComptuteReduce using foldl.
2020-06-06 13:23:31 -07:00
handar423 2ec7caa073 fix small bug about dense_grad (#5695) 2020-06-06 09:10:17 +05:30
abergeron de54754480 Fix the values for test_fmod since it fails way too often otherwise (#5723) 2020-06-05 14:17:41 -07:00
Tianqi Chen 592711ea1f [TEST] Fix flaky topi/tests/python/test_topi_pooling.py:test_adaptive_pool (#5736) 2020-06-05 12:13:17 -07:00
Cody Yu 24597f0a07 Fix reshape usage in ARM Winograd (#5732) 2020-06-05 10:27:57 -07:00
akosik-anyvision fee5d547f6 Change 'delete's in Relay VM Instruction dtor to 'delete[]'s (#5735) 2020-06-05 08:39:20 -07:00
Thomas Viehmann e1b11712ac ROCm: Add warp shuffles and enable reductions (#5727)
Thank you @masahi and @wpan11nv for the feedback
2020-06-05 18:49:37 +09:00
Samuel fbc2b87b5c [ONNX]MaxRoiPool, Mod & Xor op support added (#5729) 2020-06-05 14:48:44 +09:00
Tianqi Chen 8a98782cdf [REFACTOR] Separate ArgTypeCode from DLDataTypeCode (#5730)
We use a single enum(TypeCode) to represent ArgTypeCode and DLDataTypeCode.
However, as we start to expand more data types, it is clear that argument
type code(in the FFI convention) and data type code needs to evolve separately.
So that we can add first class for data types without having changing the FFI ABI.

This PR makes the distinction clear and refactored the code to separate the two.

- [PY] Separate ArgTypeCode from DataTypeCode
- [WEB] Separate ArgTypeCode from DataTypeCode
- [JAVA] Separate ArgTypeCode from DataTypeCode
2020-06-04 15:04:17 -07:00
Dhruva Ray 34c95a89ea [Frontend][TFLite] Add parser support for shape and range (#5329)
* [Relay][Frontend][TFLite] Add parser support for shape and range

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* Incorporated review comments and used new functions

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* Few cosmetic changes

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* Removed an extra line added by rebase...

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>
2020-06-04 10:55:38 -07:00
Dhruva Ray c2e248f07e [TOPI,RELAY][TFLITE] Sparse to dense operator (#5447)
* [Relay][Frontend][TFLite] Add parser support for shape and range

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* [TOPI,RELAY][TFLITE] Sparse to dense operator

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* use param name in documentation

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* sphinx doc errors fixed

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* incorporated review comments

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* Missing a blank line...

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* use get_tensor_expr

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* Accidently removed this function in the rebase...

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* support default value for default_value

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* clang format fixes

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>

* topi pylint fixes

Signed-off-by: Dhruva Ray <dhruvaray@gmail.com>
2020-06-04 10:54:56 -07:00
Thomas Viehmann 490510d463 codegen llvm: move nvptx-specific intrinsic handling into codegen_nvptx (#5726)
See discussion in #5600.

I'm also throwing in a pointer lifetime fix for the context held by
NVPTX because otherwise topi/tests/python/test_topi_softmax.py
would sefault for me. With the test, I can also run resnet-18 on
the nvptx target in gpu_imagenet_bench.py.
2020-06-04 08:46:55 -07:00
Junru Shao 89359907d6 Fix runtime::String backward compatibility in JSON (#5725) 2020-06-04 08:29:03 -07:00
Wuwei Lin a64208910b [AutoTVM, Relay] Clear compile engine after task extraction (#5724) 2020-06-03 23:47:04 -07:00
Deepak 43dcbc6bd4 [TENSORFLOW]StatefulPartitionedCall/PartitionedCall Ops support added (#5617)
* Implemented functionInvocation Unit Test for StatefulPartitionedCall operator(working) and initial changes for placeholder(not working as of now)

* Placeholder exercises with tvm

* placeholder interim

* SPOP Test cases structure

* New test cases for spop

* miscellaneous test cases for spop

* Placeholder samples..working with shapes explicitly passed

* Variables test case. Works with the same fix of shape_dict

* SPOP Positive test cases first iteration

* support output tensors as function args, multiple functions

* Corrected Indentation

* filewritter is only for debug purpose

* support variables in function args

* First working iteration of positive spop test cases

* Removed commented code, simplified code

* Code Reorganization- First working iteration of positive spop test cases

* corrected variable name after refactor

* Code Reorganization- First working iteration of positive spop test cases

* move code inside mapped operator function

* Removed extra line

* support variables in function args

* Removed commented code, simplified code

* move code inside mapped operator function

* Code Reorganization- First working iteration of positive spop test cases

# Conflicts:
#	tests/python/frontend/tensorflow/test_forward.py

* Code Reorganization- First working iteration of positive spop test cases

* Function invocation more test cases

* Simplified & Merged different Function Invocation Test cases

* support invocation of nested callables

no need to explicitly handle paratitioned and
statefulPartitioned condition in convert_operator function

* Simplified and Uniform testcases

* support invocation of nested callables

no need to explicitly handle paratitioned and
statefulPartitioned condition in convert_operator function

* Simplified and Uniform testcases

* removed duplicate and renamed testcase

* Negative scenario added for testing operator statefulness. Only Exception to stateful operators are Partitioned & StatefulPartitionedOp which have capability to execute even stateless operators within them

* Miscellaneous reorganization changes for spop scenarios

* Miscellaneous reorganization changes for spop scenarios

* Corrected import of tensorflow modules safely using try except and other code reorganization

* Negative scenario for resource variables handled

* Documentation update for code

* SPOP change in function handling

* handle nested subgraph

* refactor

* get op def compatible with tf 1x & 2x

* Fixed liniting issues

* added doctsring and few nits

* Merged changes for positive test cases and negative test cases

* Moved StatefulPartitionedCall test case to the end of the TC list

* Fixed some typos and semantics

* dmlc-core

* dmlc-core

* fixes

* Addressing Review comments in the PR for SPOP support

* Fixed pylint errors

* Corrected tensorflow import syntax

* Placed the op_def_registry module import outside of for loop

* Removed new stateful operators list and combined these operators with missing operators to display as single list. Also removed throwing seperate exception for stateful ops

Co-authored-by: Prashant Sail <psail4444@gmail.com>
Co-authored-by: maheshambule <mahesh_ambule@persistent.com>
2020-06-04 10:03:42 +05:30
Samuel 3d61dc892c [ONNX]ReduceL1, ReduceL2, ReduceSumSquare, ReduceLogSum ops added (#5721) 2020-06-04 11:06:21 +09:00
abergeron 36aa895012 Fix generating types like float44 and float88 (#5722) 2020-06-03 14:24:27 -07:00
Junru Shao 64ac555063 [Object] Restore the StrMap behavior in JSON/SHash/SEqual (#5719) 2020-06-03 13:34:44 -07:00
Junru Shao 9151a519b9 [Object][FFI] Introduce runtime::String::CanConvertFrom (#5718)
* [Object][FFI] Introduce runtime::String::CanConvertFrom

* Update container.h
2020-06-03 08:01:55 -07:00
lixiaoquan 927510a6f3 Avoid downloading when TOPHUB_LOCATION is NONE (#5720) 2020-06-03 08:01:10 -07:00
Samuel c1f3b2f496 [MXNET]Softmin, trunc op support added (#5715) 2020-06-03 17:29:38 +09:00
Junru Shao 4347b41a5e [Object] Unify StrMapNode and MapNode (#5687)
* Pass cpptest and py unittest

* fix graph runtime

* right fix

* fix a bug that runtime::String's operator < is actually compare by address

* Update container.py

* Renaming

* Address comments

* lint

* Replace ObjectHash in object.py
2020-06-02 16:33:09 -07:00
tobe 062a244d66 Rename tvm_dso_op to libtvm_dso_op (#5714) 2020-06-02 09:22:42 -07:00
Liangfu Chen 3d0606313f [BUGFIX][CRT] Fix Compilation Error in CRT (#5713) 2020-06-02 09:22:14 -07:00
Tianqi Chen 13277a5fd9 Remove opengl runtime and cmake (#5712) 2020-06-01 20:51:49 -07:00
Tianqi Chen f272e06095 Remove deprecated opengl files (#5711) 2020-06-01 17:53:33 -07:00
Samuel 663a5ab46a [PYTORCH]ReplicationPad support added (#5708) 2020-06-02 09:15:41 +09:00
Cody Yu 43162d669d [PatternLang] Simplify Pattern API Implementations (#5703)
* Add syntatic sugar; include pattern to API docs

* fix doc warnings
2020-06-02 09:14:33 +09:00
Tianqi Chen afc239aeb8 [REFACTOR][PY] relay.op.Op -> tvm.ir.Op (#5705)
* [REFACTOR][PY] relay.op.Op -> tvm.ir.Op

* Improve the error check
2020-06-01 15:35:06 -07:00
Rand Xie f280883f4c fix typo: anchor windoes should be anchor windows (#5706) 2020-06-01 08:39:36 -07:00
ANSHUMAN TRIPATHY b0959d4906 [Arith] ExtendedEuclidean merge impl to int_operator (#5625) 2020-06-01 08:38:26 -07:00
Neo Chien 12cfe4ae47 [AutoTVM][TOPI] Fix bifrost spatial packing conv2d auto tune (#5684)
* [AutoTVM][TOPI] Fix bifrost spatial packing conv2d auto tune

* [AutoTVM][TOPI] Putting placeholder replacement in compute

* Fix winograd kernel replacement

* Fix sanity check: Line too long
2020-05-31 12:32:25 -07:00
Samuel 55aefc22a6 [PYTORCH]floor_divide support for squeezenet (#5702)
https://github.com/apache/incubator-tvm/issues/5133#issuecomment-636330705
2020-05-31 06:25:36 +09:00
Zhi c55ed37169 [REFACTOR][RELAY] Replace build_config with PassContext (#5698) 2020-05-29 21:59:35 -07:00
Cody Yu 910edef099 [BYOC] Support Tuple Output in C/DNNL Codegen (#5701)
* Support tuple output runtime

* fix unit test
2020-05-30 11:11:24 +09:00
Balint Cristian 879158a071 [ONNX] Skip ADD inside Gemm op when vector is zero (#5697) 2020-05-30 10:10:22 +09:00