Commit Graph

131 Commits

Author SHA1 Message Date
Andrew Reusch 9b43a646fc Rename GraphRuntime to GraphExecutor (#7653) 2021-03-29 20:07:21 -04:00
Tianqi Chen c8064b3ca6 [REFACTOR] Remainings of util => utils (#6778) 2020-10-29 13:46:31 -04:00
Lianmin Zheng 4e6fe36b90 [AutoScheduler] Improve hyperlinks in the tutorial (#6521)
* improve auto-scheduler tutorials

* improve tutorials

* fix lint
2020-09-21 17:46:52 -07:00
Lianmin Zheng eee04c089c [ANSOR] Auto-scheduler tutorial for GPU and necessary refactor/fix (#6512)
* add gpu tutorial

* refactor mutation in evolutionary search

* update

* update double matmul

* fix lint

* add double matmul test

* fix mutate compute location

* fix sketch search policy

* fix lint

* update

* address comments

* fix PruneInvalidStates
2020-09-19 15:38:29 -07:00
Lianmin Zheng 8843e7625a [TUTORIAL][ANSOR] Using the template-free auto-scheduler on CPU (#6488)
* add tutorial

* add tutorial

* update

* Apply suggestions from code review

Co-authored-by: Cody Yu <comaniac0422@gmail.com>

* address comments

* fix bugs

* add the exmple for resuming the search

* fix lint

Co-authored-by: Cody Yu <comaniac0422@gmail.com>
2020-09-16 19:14:09 -07:00
Tianqi Chen 0a4ee30da7 [REFACTOR] topi -> tvm/topi (#6186)
This PR migrates the topi library as a sub namespace of tvm.
2020-08-02 09:29:29 -07:00
Trevor Morris aa035f4650 [Relay/TOPI][OP] Add meshgrid op in Relay, TOPI, Pytorch frontend (#5961)
* Add meshgrid op with pytorch importer

* Fix c++ lint

* Fix pylint

* Meshgrid: add scalar test for pytorch, add topi python wrapper

* Add indexing mode attr.

* Add MeshgridAttrs python binding

* c++ lint
2020-07-02 11:14:33 +09:00
Mahesh Ambule 3e72be58f3 [Relay, Topi] [Frontend][TFLite, MXNet] ReverseSequence operator (#5495)
* TFLite reverse_sequence op

* TFLite add_n implementation

* reverse_sequence implementation

* reverse_sequence implementation

* reverse sequence

* TOPI,Relay,TFLite - Reverse Sequence

Signed-off-by: maheshambule <mahesh_ambule@persistent.com>

* Reverse Sequence small fixes

Signed-off-by: maheshambule <mahesh_ambule@persistent.com>

* lint fixes

Signed-off-by: maheshambule <mdambule07@gmail.com>

* TFLite reverse_sequence op

Signed-off-by: maheshambule

* MXNet SequenceReverse implementation

* clang format

* clang format

* review comment fixes
2020-06-16 20:53:08 -07:00
notoraptor f677af0e9b [topi][relay] Add operation gather to relay. (#5716) 2020-06-12 08:24:56 -07:00
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
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
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
Andrew Reusch b716a97136 add tvm.micro pydoc to sphinx (#5661)
* add tvm.micro pydoc to sphinx

* making build pass and addressing tqchen comments
2020-05-26 11:30:19 -07:00
Tianqi Chen 702fd0f0f4 [WEB][RUNTIME] TVM WebAssembly JS Runtime (#5506)
* [WEB] Remove the old web runtime

* [WEB][RUNTIME] TVM WebAssembly Runtime

This PR introduces a brand new TVM web runtime based on the WASM standard API.
Main highlights:

- The new runtime is rewritten using the Typescript.
- The new runtime now directly interfaces with WebAssembly's standard API,
  instead of relying on emscripten's API.
  This change will make the js runtime more portable to runtime variants.
  For example, we could also try to make it interface with the tvm's rust runtime implementation.
- System library can be provided through WASI
  - We also build a hack to enable Emscripten to generate a WASI like
    bundle for runtime environment on the Web.
- The wasm generation now uses the mainlin LLVM.
- Dynamic link(dlopen) is not used due to limitation of wasm,
  instead we rely on the recent new RPC refactor to directly
  restart a new session for each wasm binary sent to the RPC.

* Address review comments

* Skip tensorcore test
2020-05-07 13:47:36 -07:00
Tianqi Chen 1f6c498bcb [DOCS] Migrate some markdowns to rst, fix sphinx3 warnings (#5416)
* [DOCS] Migrate some markdowns to rst, fix sphinx3 warnings

* Add note block
2020-04-23 12:40:11 -07:00
Tianqi Chen 6cb5b882b1 [TIR] Enhance Substitute, python bindings for Substitute/PostOrderVisit/IRTransform. (#5400)
Substitute now takes a std::function to customize more replacing behaviors.

Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>

Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>
2020-04-22 13:25:36 -07:00
Samuel 6e36da3571 [TOPI][PYTORCH]Logical & Bitwise operator support (#5341) 2020-04-16 17:34:36 +09:00
Tianqi Chen cc8cacb144 [DOCS] Bring relay docs to the top-level flat view (#5343)
- Changes most of the relay docs to use autosummary.
- Bring relay API docs to the top-level flat view for easier discovery
- Removed a few cases of re-exports.
2020-04-15 15:32:59 -07:00
Tianqi Chen 275e317c56 [RELAY] Remove re-exports of tvm.transform (#5337) 2020-04-14 17:03:15 -07:00
Tianqi Chen 6e1cd8256e [REFACTOR] tvm.hybrid -> te.hybrid (#5223)
Rationale: The current hybrid module is more aligned with the te part.
We might consider add a new varient of hybrid script that support the unified IR later.
This refactor paves for the potential later changes.
2020-04-02 16:56:24 -07:00
Tianqi Chen e60003c200 [REFACTOR][TIR] Introduce ExprDeepEqual, Remove IRDeepCompare (#5206)
* [REFACTOR][TIR] Introduce ExprDeepEqual, Remove IRDeepCompare

This PR introduces ExprDeepEqual which reuses the StructuralEqual infra.
We migrated the usecases of ir_pass::Equal to ExprDeepEqual and StructuralEqual.

* Address comments
2020-04-01 17:14:49 -07:00
Tianqi Chen 0a0e58bfa4 [REFACTOR][TIR] Introduce PrimFuncPass. (#5139)
* [REFACTOR][TIR] Introduce PrimFuncPass.

- Introduce PrimFuncPass
- Convert one pass to the unified Pass API.

* Address comments

* Fix comments
2020-03-24 08:15:54 -07:00
Mahesh Ambule 9037f4ec98 [Relay, Topi, TF Frontend] Isfinite operator (#4981)
* isfinite doc update

* isfinit expr

* isfinit expr

* isfinite schedule reg

* isfinite python binding

* isfinite python binding

* relay register isfinite

* isfinite type relation

* intrin isfinite

* topi isfinite

* testcase topi isfinite

* tf frontend isfinite

* tf frontend isfinite testcase

* test case relay isfinite

* small fixes

* test forward tf isfinite

* test cases injective for cuda

* remove float16 test case

* add support for isinf

* remove unwanted import

* fix conflict
2020-03-23 20:17:12 +09:00
Mahesh Ambule fdc8b0dd17 [Relay, Topi] [TF, MXNet] Unravel Index operator (#5082)
* first cut unravel_index

* merge fixes

* change rates to dilations

* unravel_index op relay, topi, mxnet, tf

* doc changes

* small changes

* remove empty unravel and argwhere attrs

* remove empty unravel and argwhere attrs
2020-03-23 10:40:54 +09:00
Zhi 36a83c7f05 [docs] Update relay docs (#5112)
* Update relay docs

* any -> py:func

* make clean
2020-03-20 19:58:48 -07:00
masahi 2b6612317b [TOPI, Relay refactor] Move Dilation2d from nn to image namespace (#5110) 2020-03-20 15:20:13 -07:00
Zhi 7ca3212f06 create function.py (#5087) 2020-03-18 08:56:55 -07:00
Zhi 4aff8dc13f [Refactor][Relay] Refactor Relay Python to use new FFI (#5077)
* refactor relay python

* revert relay/ir/*.py to relay

* Address comments

* remove direct access to analysis and transform namespace
2020-03-17 08:33:10 -07:00
Mahesh Ambule 646cfc6371 [Relay, TF Frontend] Dilation2D operator support (#5033)
* update docs for dilation 2d

* dilation2d compute

* dilation2d register

* dilation2d rel compute

* dilation2d strategy

* dilation2d attrs

* dilation2d generic schedule

* dilation2d tf frontend support

* dilation2d tf frontend test case

* dilation2d test cases

* pylint fixes

* add exception for cuda target

* Update docstring

* Update docstring

* change rates to dilations

* removed unused param

* merge master

* Update nn.py

* Update nn.py
2020-03-16 23:54:32 -07:00
Tianqi Chen 1dbdcfb5e0 [DOCS] Sphinx -- Introduce alias detection. (#4954)
* [DOCS] Sphinx -- Introduce alias detection.

Background: some of our namespaces import function from another
namespace. For example tvm.te imports most of the operators from tvm.tir.

Previously we manually exclude these aliases from the doc.
However that means we can not link them by the alias name.

This PR adds a sphinx callback plugin to detect such aliases, and create a rubric block
on the button of its current docstring `Alias of the original class`.
It is done in a way so that we can refer to the generated docs.

We also fixed a few docs errors.

* Fix most of the issues
2020-02-27 14:27:37 -08:00
Tianqi Chen 9816efc2df [REFACTOR][PY][API-CHANGE] Remove legacy python files. (#4943)
* [REFACTOR][PY][API-CHANGE] Remove legacy python files.

Remove legacy python files.
Use the te namespace for most of the tensor expression primitives.

- tvm.create_schedule -> tvm.te.create_schedule
- tvm.placeholder -> tvm.te.placeholder
- tvm.compute -> tvm.te.compute

* Remove top-level exposures.
2020-02-26 21:10:47 -08:00
Neo Chien b598c545b4 [DOCS] Fix Sphinx Warning: the target found for cross-reference (#4925)
* [DOCS] Fix Sphinx Warnings: the target found for cross-reference warnings

* Fix the warning: undefined label
2020-02-25 20:23:27 -08:00
Alex Wong 87c20bb2b2 [Relay] Add a PyTorch to Relay Parser (#4497)
* Add a PyTorch to Relay parser

* Add alexnet, googlenet, mnasnet, shufflenet wip

* Fix lint

* Remove fix for shufflenet

* Lower check

* Pull changes from neo-ai/tvm changes

* Remove commented out section

* Use infer_shape everywhere

* Change back to using trace instead of path in from_pytorch

* Parse state_dict to add param names

* Umbrella single_op under test_forwards

* Remove print and cleanup call

* Check if update to test broke CI

* Retrigger CI

* Add back in updated tests

* Try splitting up tests

* First pass at flexible typing, implemented for ones

* Add int32 for all ops

* Remove print statements

* Fix lint

* Broad except

* Add other tensor types

* Temporarily use old tests

* Retrigger CI

* Lower type names

* Use numpy to convert in dense op

* Fix lint

* Remove print

* Need to cleanup but verify int32 works for add

* Rough tests for different types, a lot of types are not supported on CPU

* Probably doesn't build, need to save work as I have to switch branches (constantly)

* Parse param type

* Remove print stmt in parser

* Clean up some code

* Working on flaot32 for bn

* Add resnet18 double type

* Fix lint

* Temporarily move PT tests first

* Temporarily add back refactored tests to fix mem issue

* Add more type test and temp remove some tests

* Comment out tests, hopefully CI prints a trace

* Get stack trace

* Remove operator dict key, rename op_name to node_id, remove dead code

* Make relay map a list

* Remove some hacky string stuff

* Move to PyTorch 1.4

* Remove input_type as param

* Remove _get_fill_value, fix full ops

* Remove unused code and combine ops for identity and none

* Remove fn_param

* Clean up main loop

* Remove useless if/else for outputs

* Remove ir_names, only used once

* Remove some string hacking

* Remove string parsing to get output name

* Fix bug with output sizes of nodes

* Use attributeNames in parse ops

* Remove continue and add_op in parse_op

* Do this everywhere, use assert instead of explciitly type casting

* Remove unnecessary swap

* Slight refactor for elemwise input parse

* Use a copy of graph everywhere

* Rename nid_to_node_name

* Refactor parse import prereqs

* Clean up input node kind check

* Clean up conditionals

* Clean up add_op

* Cleanup type for ones and zeros op

* Fix lint

* Add torch install to CI

* Actually use torch

* Try moving import torch to only where it's needed

* Import torch for CI

* Use take op for select

* Temporarily add ignore for jit inline pass for CI

* Use CompleteTensorType, might be a PT 1.2 only thing

* Use different types in elemwise op

* Use float16 ones

* Fix float16 test

* Remove the temp docker changes

* Remove temp test

* Temporarily comment out original tests

* Remove file

* Empty cache after each test

* Add some prints and lower input sizes

* Try using no grad

* Trying to globally set grad off

* Use no grad for torchvision

* Remove xfail tests

* Remove VGG and AlexNet due to some issues

* Combine pooling tests

* Remove extra test file

* Remove single op, remove larger pooling tests

* Remove maxpool3

* Remove debug prints

* Remove inference call and add no_grad in measure latency

* Use standard string start char

* Remove redundant infer_shape in slice

* Convert most to checks to just expr

* Remove extra paren

* More refactor of isinstance

* Add helper for creating typed constants

* Assert instead of return when no matching type

* Remove network variants

* Add no_grad when forward, remove deatch, fix lint

* Change isinstance to expr in transpose

* Use opnotimplemented, refactor

* Fix full ops, remove duplicate tests

* Never use shape field unless we know the type

* Remove comma, retrigger CI

* Add paren, retrigger CI

* Use inline if-else for flags

* Throw exception instead of assert

* Remove version check for CI

* Check version when doing inline pass

* Fix lint

* Lower more input sizes

* Add new line, conv2d only accepts weight as expr

* Use tvm.runtime.ndarray

* Remove change to torch version install

* Try no grad for mobilenet

* Fix lint

* Fix lint again

* Revert to last passing

* Delete test files

* Ignore lint

* Revert back

* Comment out mobilenet

* Clean up compare compiled and baseline outputs

* Use IRModule

* Add todos

* Refactor use_bias

* Add todo for fix conv op channels

* Change input to data type

* Remove todo

* Handle channel multiplier > 1
2020-02-24 20:14:45 -08:00
Cody Yu 98e7709ff9 [DOCS] Fix Sphinx Warnings (RST indent, cross-ref, and image scale) (#4920)
* fix indents

* Fix image scale and cross-ref
2020-02-20 14:09:34 -08:00
Cody Yu fd6d7837ed [DOCS] Fix sphinx warnings (#4917)
* Fix Python docstrings

* More fixes

* Fix lint
2020-02-20 09:24:37 -08:00
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