Commit Graph

3862 Commits

Author SHA1 Message Date
Michalis Papadimitriou 5d0367a137 [QNN] Add qnn op for abs to fix wrong scale on quantize (#12287)
* [QNN] Add qnn op for abs to solve wrong scale on quantize

* Fix for pylint to allow redefine abs

Co-authored-by: Michalis Papapdimitriou <mpapapdimitriou@octoml.ai>
2022-08-04 14:07:28 -06:00
Sevin F. Varoglu 2866f315f9 [FQ2I] Add attrs to adaptive_avg_pool1d (#12290)
* Add attrs to FQ2I adaptive_avg_pool1d

* Fix failing test and add param
2022-08-04 14:06:40 -06:00
zhang-yi-chi cfa55251b2 [Relay][Frontend][Onnx] Add RNN operation for ONNX frontend (#12213)
* Add RNN operation for ONNX frontend.

* link checks

* rm test_rnn_batchwise in unsupported_onnx_tests

* merge similar codes to class methods

* implement opset 14 and refactor test_forward

* reformat verify_rnn_helper

Co-authored-by: 张亦驰 <zhangyichi1@corp.netease.com>
2022-08-04 11:18:02 -07:00
Xiyou Zhou 46a8498ba9 [MetaSchedule] Enhance Conv2d NCHW Winograd Schedule Rules (#12127)
* Update winograd schedule rules.

* Remove extra part for setting local storage scope.

* Fix bgemm schedule.

* Add winograd tile size to annotation.

* Finish winograd schedule rules.

* Process add relu.

* Modify to nchw rules.

* Add missing nchw output rules.

* Add winograd conv2d nchw search space test.

* Fix lint.

* Leave consumer of output to autoinline.

* Remove bgemm rules.

* Remove bgemm schedule rule annotation.

* Update unit test.

* Fix test case.
2022-08-03 14:42:08 -07:00
Mehrdad Hessar 6f831137c9 [microTVM] Refactor pytest fixtures (#12207)
* Refactor micro test fixtures

* fix error

* fix scope

* address @guberti comments

* fix help message

* rename tvm_debug and added .gitignore

* fix bug

* fix bug
2022-08-03 10:58:15 -07:00
Greg Bonik 39ffe0a5ce [TVMScript] Add object path tracing to StructuralEqual (#12101)
Motivation: when two IR objects fail a structural equality check, currently there is no easy way to
find out which part of the IR caused the mismatch. In this PR, we modify the `StructuralEqual`
infrastructure to also optionally return a pair of `ObjectPath` objects that point to the mismatch.
(See https://github.com/apache/tvm/pull/11977). In the upcoming PRs, we will pass these paths to the
TIR printer, so that it could highlight the mismatch location nicely.

Tracking issue: https://github.com/apache/tvm/issues/11912
2022-08-03 01:28:59 -07:00
Mehrdad Hessar aa0d2bb098 [microTVM]Fix dense_dsp schedule in autotuning (#12271)
* dense layer used in autotune

* format
2022-08-02 16:05:23 -07:00
Josh Fromm b8893b557a [Relay][Op] Trilu operator implementation (#12124)
* Added topi trilu implementation

* Implemented and tested full Trilu op.

* Fix test type.

* Add tril zero tests.

* Add pytorch trilu integration.

* Clean up torch integration.

* Readded skip for zero tests.
2022-08-02 13:48:59 -06:00
masahi 1da66d7df2 [MetaSchedule] Check auto tensorization applicability in MultiLevelTilingWithIntrin (#12263)
* Check auto tensorization applicability in MultiLeveltilingwithintrin

* fix qbert loader

* add MultiLevelTiling rule in integartion test

* unused import

* fix cpp format

* add more test

* Check for tiling failure
2022-08-02 12:23:34 -07:00
Andrey Malyshev b05dca1f19 [Adreno] Add markup pass of relay tensors for static texture planning (#11878)
* [Adreno] Add static texture markup relay pass

Co-authored-by: Chris Sullivan <csullivan@octoml.ai>

* lint check

* Remove hardcoded texture limit, check through target options

* fix cpplint

* Add winograd into annotation pass

* fix clang

* Remove extra call of PlanDevice in OptimizeImpl

* Remove one more extra call of PlanDevice in OptimizeImpl

* Fix/add scopes for static texture planning tests

* Remove test_2conv2d as duplication of test_plan_device_issue

* remove comments in test_residual_block

* address review comments

* fix black hits

* Add textures test descriptions

* Address PR comments

Co-authored-by: Chris Sullivan <csullivan@octoml.ai>
2022-08-02 09:10:48 -07:00
Luke Hutton 759a648cd5 [TVMC] Only load extra targets when there are workspace pools (#12253)
After #11427, `tvmc compile` wouldn't work for external codegens that
don't have a `Target` registered by `TVM_REGISTER_TARGET_KIND`. Such
external codegens can be expected to have no workspace pools and may not
always have a target associated as their implementation predates this
mechanism. While it is likely a `Target` is specified for all external
codegens in the future, we should still support external codegens
without an associated `Target` until this is enforced.

Co-authored-by: Chris Sidebottom <chris.sidebottom@arm.com>
2022-08-02 10:10:40 +01:00
Luke Hutton a9df801543 [ETHOSN] Upgrade NPU driver stack to v22.05 (#11759)
* [ETHOSN] Upgrade NPU driver stack to v22.05

In updating the driver stack to v22.05 some additional things needed
changes:
* Prevent split being offloaded to the NPU which is not supported in
  v22.05.
* Removes compile algorithm configuration option since this was removed
  in v22.05. Versions before v22.05 will use the default option.
* Managing some API changes.
* Updating network compile hashes.
* Updating expected error message for overall scale bounds check.

Change-Id: I09343c398a1f47dec44e135ff8252a6315a9b63f

* fix decorator evaluation order

Change-Id: Ib1a34093b4011bdc20fca47d474eb1786218de98

* Return none if version doesn't exist

For some reason PyTest evaluates the second skipif decorator even
if the first one marks the test to be skipped. Thus, meaning test
collection fails when we want to check the version. The workaround
is to return None when the version is not available.

Change-Id: I7cdd8cc70a9ee3c193e9a900f1011829538d975b

* Update resnet hash after rebase

Change-Id: I7555c4a4d7db4f6c7aa8d476e39277fc5cba2f0d
2022-08-02 09:33:10 +01:00
Eric Lunderberg bca0385862 [UnitTest][TIR] Testing utility for before/after transform tests (#12264)
This PR adds `tvm.testing.CompareBeforeAfter`, a generalization of the `BaseBeforeAfter` utility previously used in `test_tir_transform_simplify.py`, which performs unit tests that perform a transformation on a TIR function and compare the results to an expected TIR output.  This arose when minimizing the boilerplate required for unit tests in the implementation of https://github.com/apache/tvm/issues/12261.
2022-08-01 17:46:35 -07:00
Matthew Brookhart c2ec95616e [Fq2i][ fix output type on fq2i binary ops with constant inputs (#12236)
* fix output type on fq2i binary ops with constant inputs

* allow off by one on test
2022-08-01 15:50:23 -07:00
Mehrdad Hessar e2d139af9d [microTVM][ARM] Enable tests that were skipped unintentionally (#12223)
* fix bug to enable tests

* fix import issue
2022-08-01 13:10:35 -07:00
Junru Shao 4ec8683fb6 [MetaSchedule][Test] Add unittests for CBR (#12252) 2022-08-01 20:36:24 +08:00
billishyahao a49273e050 Enable conv family fused with mish (#12228) 2022-08-01 17:56:49 +09:00
Lite Ye 834e998618 [TVMScript] Python Expression Precedence (#12148)
This PR:

- Handle expression (operator) precedence during Python code printing (`(* 1 (+ 2 3))` prints as
`1 * (2 + 3)`)
- Addresses remaining feedback from previous PR #12112
- Reformats Python import with isort

Tracking issue: #11912
2022-07-31 23:45:44 -07:00
Ivy Zhang c07d77f99c [BYOC-DNNL] add post_sum pattern (#12151)
* add post_sum pattern

* add checkers for sum pattern

* fix lint

* fix error in test_pass_partition_graph

* fix lint error
2022-08-01 10:32:52 +09:00
Junru Shao a842449d23 [MetaSchedule][Test] Add unittests for T2D (#12249) 2022-07-31 16:55:15 -07:00
Yaxing Cai a231a1d724 [Fix] Fix some errors in unittests (#12245)
- test_aot_legalize_packed_call.py: `T.preflattened_buffer` returns `void`
- test_tir_intrin.py: `type` here should be `buffer_type`
- test_tir_transform_flatten_buffer.py: `extents` should be `list`
- test_tir_transform_hoist_expression.py: change `tir` into `T` and register `Let` expression in `script/tir/intrin.py`
- test_tir_transform_storage_flatten.py: `T.allocate` has no argument named `strides`
2022-07-31 02:17:04 -07:00
woobinw 66a1b9f392 fix bug: KeyError, can't find some parameter key (#12211)
Co-authored-by: woobinw <Wubin.Wu@imgtec.com>
2022-07-30 23:37:53 -07:00
Matthew Brookhart 1d39f2c974 [FQ2I] fix unary op output affine type in fq2i (#12224)
* fix unary op output affine type in fq2i

* better names

* add option to force to positive values for ops that are undefined on negative values
2022-07-30 20:00:55 -07:00
Junru Shao 9f16b607c8 [TVMScript] Doc Definition (#12244)
This single-file PR is automatically generated by a script that describes the Doc AST.
2022-07-30 19:58:08 -07:00
Tristan Konolige 961a7c70d7 [ROOFLINE] Add CUDA support to roofline analysis (#12205)
* [ROOFLINE] Add CUDA support to roofline analysis

Add functions to estimate peak flops and bandwidth for CUDA. Add a new
registration mechanism to the roofline analysis to support adding any
target. This mechanism uses generic functions with overrides. New
targets only need to add `estimate_peak_bandwidth` and
`estimate_peak_flops` functions.

Also fix cuda codegen and tensorcore_infer_fragment.cc to support
filling matrix_a and matrix_b fragments.

* formatiing

* move statement back inside loops

* print out report for debugging

* default to avx2

* review comments
2022-07-30 16:35:25 -07:00
Jiawei Liu e756980b41 [UX][TVMSciprt] Use HTML formatter in notebook environments (#12240)
Previously we use ANSI color sequences to highlight TVM script. In jupyter notebook environments, such color sequence will be recoginized and translated to corresponding HTML to display things. 

This works fine for most notebook environments (including the jupyter notebook and the VS Code plugin). Recently, thanks to @tqchen, we found that Google Colab does not well support ansi color sequence for 24-bit colors (`JupyterLight` and `VSCDark`) that all its displayed colors are unexpectedly black/gray/white. To also bring highlighting in Colab, in this PR, we directly render the highlighted code with HTML when a notebook environment is detected.
2022-07-30 14:33:45 -07:00
arangasa c6d733a7eb [TOPI][HEXAGON] Implement depthwise conv2d slice op. (#12218) 2022-07-29 14:01:57 -05:00
Jiawei Liu d19570fb23 [UX] highlight tvm script (#12197)
* feat(ux): highlight tvm script

* resolve dependency

* refact(tvmscript): highlight fallback as plain text with warning; put ansi colors as default terminal style

* refact(tvmscript): make terminal style close to the default notebook style

* fix(pylint): disable=import-outside-toplevel

* fix(ci-dep): Pygments>=2.4.0 to support ansicolors w/o #

* refact: making Pygments versioning most robust and user-friendly

* fix: pylint var naming
2022-07-29 10:50:00 -07:00
Xiyou Zhou 578ef035b2 Fix comments. (#12220) 2022-07-29 00:52:55 -07:00
Ashutosh Parkhi 9a4d80c5fe Removing header arm_math.h which has disappeared after CMSIS upgrade (#12217)
Change-Id: I51a852321296aa6ac3e74eb44f37e8e693cb3f8f
2022-07-29 07:47:07 +01:00
Tristan Konolige 195e60b97a [FIX,ROOFLINE] Handle mismatched compiled and TIR hash (#12219)
Fix a bug where roofline analysis would crash if the provided tir
functions do no match the profiling report.
2022-07-28 12:23:32 -07:00
Wuwei Lin ee319d9d23 [MetaSchedule] Integration test for CUDA AutoTensorization (#12142)
* [MetaSchedule] Integration test for CUDA AutoTensorization

* cleanup

* fix
2022-07-28 18:03:27 +09:00
Egor Churaev 4bcaecf979 [Adreno] Fix winograd tests and accuracy (#12202)
* [Adreno] Fix winograd tests and accuracy

* Fix lint

* Fix test on cpu
2022-07-28 14:00:50 +09:00
xndcn c35c9fd3a5 [Relay][PyTorch] Add aten::lerp (#12167) 2022-07-28 13:59:30 +09:00
Lite Ye fcec5f4a76 [TVMScript] StmtDoc Definitions (#12111)
This PR addes:

- All StmtDoc subclasses
- Python bindings for StmtDoc

Tracking issue: https://github.com/apache/tvm/issues/11912
2022-07-27 16:56:15 -07:00
Siyuan Feng 88bbb40540 fix pooling documents (#12201) 2022-07-27 10:36:22 -07:00
wrongtest ca30e5e2e4 TIR Schedule primitive - decompose_padding (#12174)
Co-authored-by: baoxinqi <wrongtest@intellif.com>
2022-07-27 10:35:54 -07:00
Gavin Uberti 03aed787df [microTVM] Fix timeout of -1 breaking Arduino transport (#12189)
* Remove warning from Teensy boards

* Use a real timeout

* Skip assertion of whether a functional schedule exists

* Don't specify least significant digits for Teensy boards
2022-07-27 10:34:14 -07:00
Lite Ye 584b0f31d8 [TVMScript] ExprDoc (#12048)
This PR addes:

- All ExprDoc subclasses
- Their Python bindings
- Support of ExprDoc in PythonDocPrinter
- Unit tests for ExprDoc in PythonDocPrinter

Tracking issue: https://github.com/apache/tvm/issues/11912
2022-07-27 09:27:48 -07:00
driazati 97269fa479 Update to 0.10.0 (#12190)
This updates the version numbers after the v0.9.0 release and adds a version selector option for the v0.9.0 docs.

Co-authored-by: driazati <driazati@users.noreply.github.com>
2022-07-27 13:04:30 +01:00
Fred.Jia 5711c35ae0 [TIR Pass] decouple flatten buffer to lower opaque block pass and flatten buffer. (#12172) 2022-07-27 14:22:18 +08:00
Yaoda Zhou ea6ea42757 TVM Vertical Integration with PyTorch (#11911)
* optimize_torch & as_torch

* split files

* code formatting

* optimizing optimized_torch

* scrap your boilerplate

* as_torch polished

* configuration fixed

* Apply suggestions from code review

Co-authored-by: Lite Ye <liteye859@gmail.com>

* more document

* file deleter

* optimize deleter

* drop how-to guides

* clang-format-10

* formatter changes

* reformat

* reformat

* reformat

* reformatting

* fixed

* auto setting

* fixed

* split long string

* tune_tir

* upgrade as_torch

* optimize as_torch

* as_torch

* fixed typo

Co-authored-by: juda <yzhou@octoml.ai>
Co-authored-by: Lite Ye <liteye859@gmail.com>
2022-07-26 17:00:44 +09:00
Yuanjing Shi 21d54f9880 [PyTorch] Add aten::numpy_T (#12179)
* add numpy_T

* add warning

* fix linting
2022-07-26 08:09:48 +09:00
Dhruv Chauhan 75ec1cffa9 [TVMC] Workspace Pools Parameters (#11427)
* [TVMC] Workspace Pools Parameters

Attributes from tvmc are now passable into the created PoolInfo objects
inside WorkspaceMemoryPools. This is passed in to relay.build that get
attached to IRModule attribute.

* [TVMC] Workspace Pools Parameters

Address comments, fix linting. Testing improved.
Change-Id: Iea79329b6b9ec1cbc51e5c293449bf6dd43b00c5

* [TVMC] Workspace Pools Parameters

Update workspace pools test naming
Change-Id: Ib698d6248be1e6f44340f27db3641c985bc5c5d8

* [TVMC] Workspace Pools Parameters

Add test for parameter overrides.

Change-Id: I67d5470dcfbfbc9ab27f34e20a9269d2070193ca

* [TVMC] Workspace Pools Parameters

Rebasing over #10189
Updates to the way a WorkspaceMemoryPool object is created
Change-Id: I1f0e1d240343af311ddb3ed5c564cc1ab329f463

* [TVMC] Workspace Pools Parameters

Fix linting, fix CI
Change-Id: If75f8709ac4ad925655eca54b3e5c1bb09d025e8

* [TVMC] Workspace Pools Parameters

Add mcpu and mattr to target registry for cmsis-nn
Change-Id: I15257b8d01624c071c738cab6d12ecb84ed6cb16

* [TVMC] Workspace Pools Parameters

Added test for override on single pool when multiple pools are present
Updated functionality of parsing multiple attributes
Change-Id: I2c0745051b7a923dd7f75040bfb89bbc99376a11
2022-07-25 10:43:00 +01:00
Ivy Zhang 6eb3a1fc36 [BYOC-DNNL] suppport more dnnl ops (#11823)
* support dnnl.global_avg_pooling2d

* fuse pad-avg_pool2d

* fix lint
2022-07-25 16:16:16 +09:00
Siyuan Feng 4d84620d07 [TIR] Well-Formed Verifier (#12166)
* tir_well_formed_verifier

* fix typo

* lint

* fix testcase
2022-07-25 14:50:33 +08:00
Aakanksha Verma dc1324635a tanh float16 (#12165)
Co-authored-by: aakaverm <aakaverm@qti.qualcomm.com>
2022-07-24 16:28:09 -05:00
zhaoyang-star 76155c2f3c [QNN] Support different qnn params between in/out tensor in leaky_relu (#12116)
* [QNN] Support different qnn params between in/out tensor in leaky_relu

* format code

* format code

* fix bug

* fix format

* fix format

* fix
2022-07-22 14:33:31 -07:00
Hua Jiang ecd3c884de [Runtime][PipelineExecutor] Tutorial of using pipeline executor. (#11557)
* [Runtime][PipelineExecutor]  Tutorial of using pipeline executor.

Tutorial of using pipeline executor including the byoc use case.

* fix ci issue

* document change.

* triger build

* fix doc issue

* fix ci issue

* doc issue

* fix ci issue

* fix ci issue.

* fix __file__ not found problem.

this is a known issue of sphinx-gallery
https://github.com/sphinx-gallery/sphinx-gallery/issues/211

* fix byoc with dnnl issue

* enable dnnl and pipeline executor

* trigger build

* trigger build

* fix build issue

* trigger build

* oneflow cause crash, do test with change

* add sphinx skip

* plint

* remove from_oneflow change test.

* remove pipeline executor change for test

* plint

* enable DNNL and pipeline

* disable DNNL

* enable DNNL without pipeline

* remove dnnl and add cutlass

* use cutlass with byoc

* change into cutlass

* fix doc convention issue

* remove duplicate variable

* fix plint issue.

* address review comments.

* address review comments

* fix bug.

* polish the document

* fix plint issue

* address review comments.

* address review comments

* address review comments
2022-07-23 04:54:24 +09:00
Andrey Malyshev 8dafaf3a4d [Adreno] Fix winograd schedule to support prime shapes > 4 (#12157) 2022-07-22 17:40:52 +09:00