* [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>
* [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
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>
- 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.
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.
* [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
* [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
* 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
Move the related target modules into tvm.target.
API change:
- tvm.target.current_target -> tvm.target.Target.current
- tvm.datatype -> tvm.target.datatype
* [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
* [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