Commit Graph

78 Commits

Author SHA1 Message Date
Zhi 88cd1b1c54 Add docs for analysis namespace (#3985) 2019-09-22 02:44:07 +08:00
Neo Chien ab1853c289 [TOPI] operator support: logical_and, logical_or, logical_not (#3929)
* [TOPI] operator support: logical_and, logical_or, logical_not

* [TOPI] operator support: logical_and, logical_or, logical_not

* [TOPI] fix test cases for operator support: logical_and, logical_or, logical_not

* [TOPI] fix test cases for operator support: logical_not
2019-09-16 10:42:47 -07: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
Zhi 8a46444ffe fix some pass docs (#3767) 2019-08-13 15:23:50 -07:00
Andrew Tulloch 2ed31b24fe {relay,topi}.reinterpret support (#3599)
= Motivation

It's useful to expose the tvm::reinterpret functionality to Relay/TOPI users, as
this allows them to build (fused) operators leveraging the bitwise
reinterpretation of an operator. An example is approximate transcendental
functions, which can be implemented similar to:

```.py
    def C(x):
        return relay.expr.const(x, "float32")

    def approx_exp(x):
        x = relay.minimum(relay.maximum(x, C(-88.0)), C(88.0))
        x = C(127.0) + x * C(1.44269504)
        xf = relay.floor(x)
        i = relay.cast(xf, "int32")
        x = x - xf
        Y = C(0.99992522) + x * (C(0.69583354) + x * (C(0.22606716) + x * C(0.078024523)))
        exponent = relay.left_shift(i, relay.expr.const(23, "int32"))
        exponent = relay.reinterpret(exponent, "float32")
        return exponent * Y

    def approx_sigmoid(x):
        # <2.0e-5 absolute error over [-5, 5]
        y = approx_exp(x)
        return y / (y + C(1.0))

    def approx_tanh(x):
        # <4.0e-5 absolute error over [-5, 5]
        x = x * C(2.0)
        y = approx_exp(x)
        return (y - C(1.0)) / (y + C(1.0))
```

See unit tests for implementations of these approximate transendentals.
2019-07-23 14:43:27 -07:00
Yong Wu 313bc9de4d [TOPI][RELAY] Add op Size (#3094) 2019-07-19 15:06:34 -07:00
Zhi e3d6074a5b Clean up pass.h (#3312) 2019-07-02 09:14:52 -07:00
Xingjian Shi 8ef2217642 [RELAY] [OP] [MXNet Frontend] Add sequence_mask (#3437)
* Add sequence_mask

use exactly the same arguments as mxnet

fix

* fix lint

* fix lint

* add mxnet conversion + relay

* update

* update doc

* fix pylint

* fix doc

* address comment

* try to address comments

* try to enable shape check for valid_length

* fix

* try to fix

* fix bug

* try to fix

* address comment

* address comment
2019-06-27 21:51:04 -07:00
Haichen Shen 072f8cc75e [Relay/TOPI][Op] Add TopK operator (#3256)
* init impl for topk

* Fix cpu for topk

* init cuda impl for topk

* Add cuda for topk

* fix

* Add doc

* update doc

* lint

* lint

* lint

* x

* fix warning

* [Relay] Add TopK in tf converter

* Add frontend converter

* fix
2019-06-04 16:29:56 -07:00
Zhi 138ec7be78 [Relay][Transform] merge PassContext and BuildConfig (#3234) 2019-05-24 12:05:00 -07:00
Logan Weber 4b1d3d87a3 Add SkipVectorize pass (#3222) 2019-05-21 16:34:35 -07:00
Yong Wu 9fd8e3c513 [Relay][TOPI] operator All (#3124)
* [Relay][TOPI] operator All

* Update tests/python/frontend/tensorflow/test_forward.py

Co-Authored-By: yongwww <55wuyong@163.com>

* fix comments

* change to level 4
2019-05-20 11:56:22 -07:00
Yao Wang 147ea3b0ca [Relay][Op] Adaptive pooling (#3085)
* Add topi adaptive_pool

* Use adaptive_pool to compute global_pool

* Add relay adaptive pool2d

* Fix lint

* Fix typo

* Minor change

* Change support level to 10

* Add contrib

* Remove global pool schedule

* Add contrib module

* Fix lint

* Update doc

* Update doc
2019-05-08 17:21:41 -07:00
Hiroyuki Makino 9bfdc55c57 [Relay][TOPI] Add rsqrt operator (#2949) 2019-04-25 11:05:42 -07:00
Tianqi Chen cffb4fba03 [HEADER] Add Header to Comply with ASF Release Policy (#2982)
* [HEADER] ASF header dir=include

* [HEADER] ASF Header dir=src

* [HEADER] ASF Header -dir=python

* [HEADER] ASF header dir=topi

* [HEADER] ASF Header dir=nnvm

* [HEADER] ASF Header -dir=tutorials

* [HEADER] ASF Header dir=tests

* [HEADER] ASF Header -dir=docker

* fix whitespace

* [HEADER] ASF Header -dir=jvm

* [HEADER] ASF Header -dir=web

* [HEADER] ASF Header --dir=apps

* [HEADER] ASF Header --dir=vta

* [HEADER] ASF Header -dir=go

* temp

* [HEADER] ASF Header --dir=rust

* [HEADER] Add ASF Header --dir=cmake

* [HEADER] ASF Header --dir=docs

* [HEADER] Header for Jenkinsfile

* [HEADER] ASF Header to toml and md

* [HEADER] ASF Header to gradle

* Finalize rat cleanup

* Fix permission

* Fix java test

* temporary remove nnvm onnx test
2019-04-07 21:14:02 -07:00
Tianqi Chen f63631fc73 [RUNTIME] Scaffold structured error handling. (#2838) 2019-03-18 23:05:02 -07:00
Ashutosh Parkhi cc112c10c5 Support for sign (#2775) 2019-03-13 22:14:26 -07:00
Haichen Shen ee8058069a [Relay/TOPI][Op] Add shape op in Relay and TOPI (#2749)
* Add shapeof op in topi

* Add relay shape_of op

* Add constant folding for shape_of

* Allow shape op to specify dtype

* Add mxnet converter for shape_array

* lint

* lint

* Add doc
2019-03-13 16:14:48 -07:00
Leyuan Wang 19194e97de [Relay/TOPI][Frontend] Add tile and repeat operators in Relay and TOPI (#2720)
* tile and repeat operator added in rely

* fix pylint

* fix make warnings

* comments addressed

* fix lint error

* comment addressed
2019-03-10 23:29:51 -07:00
Yong Wu 801068f343 update relay python api doc (#2766) 2019-03-11 00:06:09 -04:00
Leyuan Wang ef58291dda [Relay][TOPI][OP] intel_graphics conv2d alterlayout support relay, added stack op (#2729)
* add stack op frontend

* concate moved

* topi stack added

* stack added

* fix stack bugs and tested

* conv2d alterlayout udpated for relay

* fix pylint

* fix cmake warnings

* cmake warnings fixed
2019-03-05 19:42:32 -08:00
Ashutosh Parkhi af69f8730b [Tensorflow, NNVM, TOPI] Support for logical operators (#2453) 2019-03-03 10:20:59 -08:00
Haichen Shen 8459006322 [Relay/TOPI][Op] Add batch_matmul in relay and TOPI (#2561)
* Add batch_dot and cpu schedule

* Add relay support for batch_dot

* Rename batch_dot to batch_matmul

* nits

* Add missing file

* Put batch_matmul and dense x86 schedule in separate files

* Fix pylint

* Remove unused import

* Add cuda schedule for batch_matmul

* Add test case with larger batch size

* Add batch_matmul in api doc

* Fix quantize pass rounding error

* Fix pylint and minor change

* bug fix
2019-03-01 14:53:46 -08:00
Yizhi Liu ee79703c3c [Lang] Layout in TVM node system (#2509)
* move layout.h & layout.cc from relay to tvm

* change ConvertLayout in relay to bijectiveLayout->Forward/backward

* add first test case

* add LayoutAxis

* add LayoutAxis struct and compiles

* simplify BijectiveLayout rule consturct

* polish func name for Layout, move impl to .cc, remove Layout::defined(), add defined() checker

* partially add layout py support

* add layout test cases

* add doc for tvm.layout & tvm.bijective_layout

* fix lint

* fix lint

* fix layout name generation bug

* fix layout typo

* address comments and add topi.layout_transform

* layout.h->data_layout.h, test_lang_layout.py->test_lang_data_layout.py
2019-02-28 12:26:22 +08:00
Haichen Shen 16b009b236 [Relay/TOPI][OP] Add arange op in Relay and TOPI (#2621)
* Add arange op

* Update docs

* Fix bug

* add sanity check in relay and mxnet frontend mapping

* lint

* nits

* pylint

* don't allow empty output from arange

* Remove empty test for arange

* Fix bug and update doc
2019-02-22 22:49:15 -08:00
Liangfu Chen 985e7d72bf Update docs for some new modules (#2454) 2019-01-17 09:08:30 -08:00
Haichen Shen a9bd5593a3 [X86][TOPI] Add AutoTVM template for dense (#2392)
* Add GEMM autotvm template for x86

* Fix tophub link

* Disable RPC server logging file delete

* Update dense autotvm template

* Fix tests

* Fix lint

* tweak

* Register two templates with different tags
2019-01-13 22:43:34 -08:00
Tianqi Chen 9d20fa1b98 [PASS][TENSOR] Use correct select semantics (#2394) 2019-01-11 10:19:09 -08:00
Jared Roesch 20afa0a535 [DOC][Relay]: Add API docs for Relay. (#1750) 2018-12-01 22:27:49 -08:00
Haichen Shen add1f90e4c [NNVM/TOPI][OP] gather_nd (#2041) 2018-10-31 15:14:01 -07:00
Pariksheet Pinjari 1eedc945b0 Update frontend.rst (#1881) 2018-10-10 21:57:03 -07:00
yuruofeifei 6fe5b108bc [NNVM][TOPI] Add mean and product operators (#1628)
* Add mean and product operators

* Fix typo

* Fix lint

* fix test

* Fix gpu schedule

* Update doc

* remove mean from topi

* Add nnvm test

* Fix cuda schedule

* Remove cuda schedule
2018-09-17 18:00:07 -07:00
Lianmin Zheng 12839e6d2b [AUTOTVM] Decouple build and run in measurement (#1661) 2018-08-28 21:56:49 -08:00
Sergei Grechanik 0edf87e854 [NNVM][TEST] Test against numerical grad (#1505)
* [NNVM][TEST] Numerical gradient testing

* [NNVM][TEST] Make some tests a little faster

* Fix the failing test_top_level3

* Target exclusion for the check_function

* Try to ignore singularities

* grad_input_vars now can't contain shapes

* Don't pass unnecessary grad_input_vars to check_function

* Multiple outputs; fixes; testing of check_function

* Use numerical_grads_params to pass parameters to numgrad checker

* Fail when no action is requested excplicitly

* Pass additional params to functions

* Silence the linter issue

* Simplified numgrad checking

* Improved docs for check_function

* Fixed the error message when no dtype is provided

* Several fixes

* Tests with shape/dtype inference for inputs

* Don't check dense's grads on cuda

* Raise an error if output dtypes haven't been inferred

* Moved shape/dtype inference into a separate function; use float32 as fallback

* Remove redundant dtype=float32

* Fix multiple outputs

* Use check_function in the rest of the test_top_level1
2018-08-23 16:49:36 -07:00
Tianqi Chen 7cb85d8196 [VERSION] Update to 0.5.dev (#1623)
* [VERSION] Update to 0.5.dev

* Update the docs to include all intrins
2018-08-20 16:28:28 -07:00
Lianmin Zheng 9e33774664 fix dependenci and improve doc (#1535) 2018-08-03 14:47:22 -07:00
Lianmin Zheng 32076df815 [AUTOTVM] TOPI integration for ARM CPU (#1487) 2018-08-02 08:59:25 -07:00
Tianqi Chen f7d05b7ce2 [CODEGEN] Enable inline llvm asm code (#1486) 2018-07-25 09:30:23 -07:00
Pariksheet Pinjari 1fb2d7e22e Add support for absolute opeartion (#1406) 2018-07-13 09:49:49 -07:00
Lianmin Zheng 6ea74d4119 [AUTOTVM] Core part of auto-tuning module (#1312) 2018-07-12 16:54:15 -07:00
tqchen e531d02288 [BUILD][DOCS] Migrate VTA CI, test, build, docs 2018-07-11 21:54:39 -07:00
Tianqi Chen 81db22c56a [RPC] graduate tvm.contrib.rpc -> tvm.rpc (#1410) 2018-07-09 15:23:41 -07:00
Liangfu Chen 3d010ed5e3 support equal and not_equal in topi (#1373) 2018-07-04 09:04:41 -07:00
Tianqi Chen db4be63c51 [TOPI] Numpy consistency: always broadcast binary op. (#1321) 2018-06-22 16:49:07 -07:00
Jian Weng 90db723d28 [FRONTEND] A Python hybrid frontend (#1251) 2018-06-22 13:47:45 -07:00
Tianqi Chen 61370e4b6c [MATH][TOPI][NNVM] introduce trunc, round (#1310) 2018-06-21 13:23:54 -07:00
Siva 76fa3ca4f6 [TOPI][IMAGE][RESIZE] Bilinear interpolation for resize and upsampling. (#1181) 2018-06-14 08:53:49 -07:00
Pariksheet Pinjari c1c32758fb [TOPI] Slice operator (#1165) 2018-06-05 13:57:54 -07:00
tqchen 5195679c5c [DOCS] Improve docs naming, fix docs warnings 2018-05-29 08:47:00 -07:00
Tianqi Chen 240be55b23 [DOCS] API doc update (#1136) 2018-04-27 17:59:11 -07:00