* added test infrastructure for frozen TF2 models
* linting with black
* removing some comments
* change in comment in sequential test
* addressed the comments
* refactored to place vmobj_to_list in a common file
* Added helper function in python/tvm/relay/testing/tf.py
Co-authored-by: David Huang <davhuan@amazon.com>
Co-authored-by: Rohan Mukherjee <mukrohan@amazon.com>
Co-authored-by: Xiao <weix@amazon.com>
* Refactor tf according to CI error
Co-authored-by: David Huang <davhuan@amazon.com>
Co-authored-by: Rohan Mukherjee <mukrohan@amazon.com>
Co-authored-by: Xiao <weix@amazon.com>
* Added docstring
Co-authored-by: David Huang <davhuan@amazon.com>
Co-authored-by: Rohan Mukherjee <mukrohan@amazon.com>
Co-authored-by: Xiao <weix@amazon.com>
* removing print
Co-authored-by: David Huang <davhuan@amazon.com>
Co-authored-by: Xiao <weix@amazon.com>
* fix bugs in the auto scheduler record:
* reformat the code
* reformat the code
* use the os.path.abspath
* change error to warning
* reformat the warning code
* fix some typos
* fix some typos
* fix some typos
* fix the port number typo
Add the possibility to provide the cross compiler options when using the
tvmc compile functionality.
With some cross compiler, toolchains --sysroot option (at least) need to be
defined.
tvmc/test_compile.py as been updated to introduce simple tests to validate
the cross options functionnality.
Signed-off-by: Vincent ABRIOU <vincent.abriou@st.com>
* Add uniform distribution generator wrt threefry PRNG
* fix lint
* remove the redundant print
* modifications based on review
* update docs
* update uniform algorithm to use bit operations only
* add type restrictions
* minor fix upon review
* update test and error information
* [TOPI] Custom schedule for standalone transpose in cuda
* check if input is not Any
* fix vta test
* check input shape
* fix injective
* move transpose out of sparse.py
* update comments, use warp size
* missspelled transform
* formatting
* rename test
* comment
* fix tests
* Supporting dynamic slice on first few axes
* fix index normalization
* update dynamic slice tests
* pylint fix
* fix loop index dtype
* fix more dtype issue
* fix bugs in the auto scheduler record:
* reformat the code
* reformat the code
* use the os.path.abspath
* change error to warning
* reformat the warning code
* [RUNTIME] Improve signal handling in python env.
Python execution environment handles the signal by caching
the signal a state and invokes the handler when execution
goes into the python interpreter.
This model can cause problem when runnning a long running
c++ function. As keyboard interrupt can only be caught in the end.
Additionally, because python registered special signal handlers.
Socket operations can return EINTR that needs to be explicitly
retried when the interrupt is not a KeyboardInterrupt.
This PR adds the following changes to resolve these problems.
- Allow execution env(python) to register CheckSignals function
to the TVM runtime.
- Add runtime::EnvCheckSignals to check the signal error.
- Add retry when EINTR is encountered in socket.
- Register the python C API functions in cython mode.
To testout the EnvCheckSignals, run the following code
```python
import tvm.testing
tvm.testing.run_check_signal(10)
```
Note that the C API functions are only registered in cython FFI mode
because ctypes have problems invoking these functions. This however
won't affect the correctness, but will defer the interrupt handling
to function return sites.
Co-authored-by: Andrew Reusch <areusch@octoml.ai>
Co-authored-by: Robert Kimball <bobkimball@gmail.com>
* Address comments
* Alternative implementation that preserves python exception.
* Address comments
* Update check signals
Co-authored-by: Andrew Reusch <areusch@octoml.ai>
Co-authored-by: Robert Kimball <bobkimball@gmail.com>
* fix conv transpose import from TF
* fix String::fromwe() to String::from()
* * fixing pytorch converter to take into account the output_padding parameter for conv transpose operations
* updating pytorch converter to correctly convert conv1d to conv1d in tvm inestead of a flattened conv2d unless under circumstances of grouped convolution
* updating pytorch converter to correctly convert conv1d transpose to conv1d transpose in tvm instead of a flattened conv2d transpose
* added tests to cover these latest additions
* * removing print statements used for debugging
* * fixing typos and formatting
* * fixing formatting
* * fixing grammar
* * formatting fixes
* * updated formatting after running pylint and python_format checks
Co-authored-by: Mikael Sevenier <mikael.sevenier@sima.ai>
* [TVMC] convert timeout flag to int
fixes Check failed: type_code_ == kDLInt (11 vs. 0) : expected int but got str
when setting the timeout option using the cli flag.
* [TVMC] fix typo in tvmc tune help
* Fixed strided_slice alteroplayout bug.
* add test for non standard int8 conv2d padding.
* Add test for large index slices.
* Us same dtype as input in strided slice.
* Improved MLF to contain workspace info
Added functionality to calculate workspace, io and constant
memory required by each primfunc and main function. Moreover,
the workspace information required by each primfunc and main
is reported in metadata.json in the Model Library Format(MLF).
- added functionality to record tir and relay primfuncs
- added tests for model_library_format changes
Change-Id: Ib4a8b787345aa35f8a1645e8a648fad84de37bce
* Improved MLF to contain workspace info
* disable AoT for now
* addressing comments
Change-Id: I5f041ec461b02dac6ea9c96ea50eb400d55eef53
* Improved MLF to contain workspace info
* addressed comments
* added aot executor support
Change-Id: I9b54a7939d8ccb3c6ce0454f0fe62866ac66eb5c
* Improved MLF to contain workspace info
* removed redundant utils.py
Change-Id: I256dd88fab31a595bf9509bd1c4ab59b0c145b1e
* Improved MLF to contain workspace info
* removed redundant ffi api
Change-Id: I9ad6795aa839edfdfd05b902d4531fb0a20e894d
Add a new API register_op
Note: Implementing a op by pure python is still limited:
1. Custom type relation (add_type_rel()) is still not
available in python.
2. Setting number inputs (set_num_inputs()) needs
plevel > 128 in python.
(see tests/python/relay/test_ir_op.py)
* [SPARSE] Improve sparse performance on ROCM
The current sparse dense gpu kernel uses warp level storage to handling
caching of data. Warp level storage uses shuffle intrinsics, which are
slow on rocm (because they actually read and write to shared memory).
Rocm does provide intrinsics to do the correct memory management, but
they are not available through tvm. Instead this PR switches to using
shared memory on rocm devices. Performance is about 2x faster.
* default to shared mem
* formatting
* formatting