Commit Graph

96 Commits

Author SHA1 Message Date
Tianqi Chen d2ae8c95d5 [DOCS] Update API docs to reflect the status after the refactor. (#4907) 2020-02-18 15:39:59 -08:00
Tianqi Chen 0b2d11a574 [DOCS] Introduce how to add hardware backend to FAQ (#4898) 2020-02-17 10:53:05 -08:00
tqchen 51a265af01 [REFACTOR][PY][API-CHANGE] Establish tvm.target
Move the related target modules into tvm.target.

API change:
- tvm.target.current_target -> tvm.target.Target.current
- tvm.datatype -> tvm.target.datatype
2020-02-12 16:36:23 -08:00
tqchen 176ffe5058 [DOCS][PY] Sphinx docs about tvm.ir 2020-02-12 08:01:22 -08:00
Tianqi Chen a566161147 [REFACTOR][PY][API-CHANGE] establish tvm.ir, migrate corresponding files (#4862)
* [REFACTOR][PY][API-CHANGE] establish tvm.ir, migrate corresponding relay files.

This PR establishes tvm.ir and migrates the corresponding relay
files into the new folder.

API Change:
- relay.Module -> tvm.IRModule

* Update with ADT

* Migrate transform

* address comments

* Migrate module

* Migrate json_compact

* Migrate attrs

* Move LoweredFunc to stmt temporarily

* temp migrate container

* Finish migrate container
2020-02-11 20:01:36 -08:00
Tianqi Chen e0122c0ea6 [REFACTOR][PY][API-Change] Polish tvm.runtime, tvm.runtime.module API update (#4837)
* [REFACTOR][PY-API] Polish tvm.runtime, tvm.runtime.module API update

This PR updates the tvm.runtime to use the new FFI style.

- Remove top-level tvm.module to avoid confusion between runtime.Module and IRModule
- API changes wrt to runtime.Module
  - tvm.module.load -> tvm.runtime.load_module
  - tvm.module.enabled -> tvm.runtime.enabled
  - tvm.module.system_lib -> tvm.runtime.system_lib
- Remove dep on api_internal from runtime.

* Update module.load in the latest API
2020-02-07 09:15:08 -08:00
Yizhi Liu 3a672e3eba [Arith] add SizeVar representing non-neg valued variable in a tensor shape (#4684)
* [arith] add ShapeVar representing non-neg valued variable in a tensor shape

* bounder remover; deal with div in int_set differently

* fix bounder_remover

* migrate unittest to use shape_var

* use tvm.shape_var in integration & relay tests

* add test case; fix Var register

* fix lint

* fix lint again

* add default ShapeVar visitor in Relay

* fix override

* fix ShapeVar visit bug

* revert IntervalSet for shape_var

* remove bound_remover

* remove is_var; use constructor for shapevar/var instead

* ShapeVar -> SizeVar; add constructor comments

* shape_var -> size_var in doc

* tindex -> size
2020-01-15 22:07:40 -08:00
Yong Wu 56416ed084 [TOPI][RELAY][OP] add op crop_and_resize (#4417)
* [TOPI][RELAY][OP] add op crop_and_resize

* fix pylint

* incorporate comments

* fix ci
2020-01-10 19:52:52 -08:00
Zhi 86092de0b6 [REFACTOR] Replace TensorObj and TensorValue with NDArray (#4643)
* replace TensorObj and TensorValue with NDArray

* NodeBase to Object in Python

* rebase
2020-01-10 16:44:16 -08:00
Haichen Shen baae28b269 [Autotvm] Use VM compile to extract autotvm tasks (#4328)
* [AutoTVM] Use vm compile in extracting task from relay

* update

* restructure vm compiler to reduce task extraction time

* x

* fix

* update doc

* udpate doc

* lint
2020-01-08 17:15:55 -08:00
Tianqi Chen e6ff3f701b [TEST] Remove nnvm related code in topi and test script (#4562)
* [TEST] Remove nnvm related code in topi and test script

* Remove docs dep
2019-12-22 09:47:34 -08:00
Yao Wang a226973ba7 [Frontend]Add TensorFlow FloorMod (#4308)
* Add tf FloorMod

* Add floor_div/mod into topi and relay

* Add to rst

* Fix test
2019-11-18 09:24:34 +05:30
Philip Hyunsu Cho 23691b8e34 Add topi.nn.fifo_buffer to TVM doc (#4343) 2019-11-14 19:42:53 -08: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
Tianqi Chen 2ded2d8caf [ARITH] Use explicit div mode in python. (#4014) 2019-09-27 07:45:25 -07:00
Kimish Patel 17c2c0a12b Expose llvm.nearbyint intrinsic. This is a faster alternate to rounding. (#4001)
* Expose llvm.nearbyint intrinsic. This is a faster alternate to rounding.

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

* Added python binding. Added test.

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
2019-09-25 11:22:54 -07:00
Jon Soifer ed9fdfb092 [Relay] Add new IR pass CombineParallelDense (#3862)
* Refactor to create abstract ParallelOpCombiner

* First draft of CombineParallelDense

* Begin to work on tests

* Test

* Refactor to move out more common code

* Clean up

* Fix

* Remove statics

* fix wording

* Start to add combine_parallel_op_batch

* Resolve PR comments

* Resolve PR comments

* dummy change to retrigger CI

* Change special case from bias_add to add

* Revert special case change

* Ignore units check

* dummy change to retrigger CI

* dummy change to re-trigger CI

* Improve docs

* Update docs

* Update docs
2019-09-24 01:12:11 -07:00
Huang, Guangtai 16d4da4d61 Add operator isnan (#3979)
* add expr `isnan`

* move to intrinsic

* doc & add to topi

* fix error from ci
2019-09-22 09:49:10 -07:00
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