Commit Graph

3830 Commits

Author SHA1 Message Date
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
wrongtest 4a94a94dfc fix T.Ptr[T.void] for packed api roundtrip (#12118) 2022-07-22 12:40:01 +08:00
Luke Hutton 4fc79b5594 [ETHOSN] Supply output tensor to issupported checks (#11944)
Some operations were being offloaded when they are not supported
by the NPU, for example mean could get offloaded with different
quantization parameters for the input and output which is not
supported. Consequently, this meant that there would be a failure
during compilation or an output mismatch at runtime. Fixing this by
supplying the output information to the issupported checks that
determine whether an operation should be offloaded.

Change-Id: I8896f83dad3d1c837fbb85bf2836fc9325f9dec9
2022-07-21 16:38:40 +01:00
Siyuan Feng e54f324311 [UX][TIR][Schedule] enhance function annotation for tir primitive (#12147)
* [UX][TIR][Schedule] enhance function annotation for tir primitive

* lint

* fix mypy

* fix pylint
2022-07-21 14:37:08 +08:00
Siyuan Feng 246aef1cdc [TIR][Schedule] fix tensorize example (#12146) 2022-07-20 08:09:54 -07:00
arangasa a1f27e57f6 [Hexagon] Slice op relu (#11449)
* Add support for relu slice op.

* Format code

* removing out_shape in relu def and lint issues

* removing out_shape in relu def and lint issues

* Changes as per the new format

Co-authored-by: Venkat Rasagna Komatireddy <89959097+rasagna-quic@users.noreply.github.com>
Co-authored-by: Venkat Rasagna Reddy Komatireddy <rasagna@hu-rasagna-hyd.qualcomm.com>
2022-07-19 15:14:05 -05:00
Gavin Uberti ae015d9ea2 [microTVM] Make Arduino API server obey timeout (#12074)
* Make Arduino API server obey timeout

* Pass arm_cpu as default option to micro testing

Syntax fix

Increase Zephyr default stack size for create_aot_session

* Set write_timeout when appropriate

* Fix unit tests and linting

Check whether arm-cpu flag is breaking tests

Update tests for arm-cpu flag
2022-07-19 09:25:12 -07:00
Wuwei Lin 97f2838938 [MetaSchedule, Testing] Generalize in/out dtype of testing te workloads (#12122)
* [MetaSchedule, Testing] Generalize in/out dtype of testing te workloads

* Fix tests
2022-07-19 09:13:52 -07:00
Philipp van Kempen 4d95f2c9c5 TVMC: Add new text/relay frontend (#10941)
* TVMC: Add new text/relay frontend

This feature enables passing a textural representation of a relay module to the tvmc command line.

Example: `tvmc compile relay.txt --target c --runtime=crt --executor=aot --executor-aot-unpacked-api=1 --pass-config tir.disable_vectorize=1 -f mlf`

Currently it is not possible to supply parameters as it is mainly intended to be used for testing certain relay functions or operators. In the future (with minor changes to the tvmc frontend api) params could be passed via an additional i.e. `params.bin` file

This commit also adds minimal unit testing of the added feature.

Resolve PR comments

TVMC: add warning if relay frontend is used

* [TVMC] populate parameters with random values instead of ones

* [TVMC] Relay frontend: do not populate input tensor buffers if --input-shapes is provided

This prevents that the constants inputs are used for Constant folding,
thus changing the complexity of the model.

If there would be a way, to distinguish between model inputs and parameter this
workaround would not be required.

* [TVMC] Relay frontend: check provided file contents before calling tvm.parser.fromtext()
2022-07-19 16:21:19 +01:00
Christopher Sidebottom 7bf5fa449c [Target] Add "features" property to Target (#12121)
This adds a generated property "features" to the `Target` which can
contain a read-only list of available features in line with
https://github.com/apache/tvm-rfcs/pull/78.

Features are re-generated upon parsing into a `Target` object rather than being
attached as `attrs`. The `Target` JSON is therefore stored without the
inferred `features` attached.
2022-07-19 08:58:49 -05:00
Luke Hutton 94d01d3565 [microNPU] Add support for hard swish (#12120)
Adds support for hard swish by populating a LUT similar to Vela's
implementation.

Change-Id: I7ca15a3e21bc91c1b41cdd4547fabaa00de96e90
2022-07-19 08:28:45 +01:00
Andrey Malyshev 6bad21e9fe [Texture] Add 2d memory support into static memory planner (#11876)
* [Texture] Add 2d memory support into static memory planner

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

* Add test verifying GraphPlanMemory work for 2d memory

Co-authored-by: Chris Sullivan <csullivan@octoml.ai>
2022-07-19 05:39:59 +09:00
abhikran-quic c0e996e291 [TOPI] [Hexagon] Uint8 Reshape and batch flatten slice ops (#12037)
* [TOPI] [Hexagon] Uint8 Reshape and batch flatten slice ops

* Fix documentation
2022-07-16 10:10:39 -05:00
Wuwei Lin 895f79f42a [MetaSchedule] Allow MultiLevelTilingTensorCore rule to specify multiple tensor intrin groups (#12113) 2022-07-16 13:17:31 +09:00
Mark Shields 0d70f690ea [Relay] Allow partial virtual device annotations. (#12107)
* [Relay] Allow partial virtual device annotations.

Previously CompilationConfig::CanonicalVirtualDevice required
the argument virtual device to contain a device type. However
now that virtual devices may contain memory scopes that's
unnecessarily strict.

With this change it is possible to write virtual device
annotations with just memory scopes, and let PlanDevices
flow those constraints along with the usual device constraints.

* - Make sure CanonicalVirtualDevice reuses FullyUnconstrained
2022-07-15 14:34:28 -07:00
Mark Shields d4365011f5 [Collage] PruneCandidates and demo_collage_partition.py (#12105)
* [Collage] PruneCandidates and demo_collage_partition.py

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

This completes our checkin of our Collage 'sketch' branch into main. Special thanks
to Matthew Barrett for his help getting this over the line.

The only C++ functionality added here is for 'pruning' candidates. This is a somewhat
speculative algorithm (and I've called that out in the comments) which tries to
elide candidate partitions which will 'obviously' not contribute to the final optimal
partitioning. For largish models such as GPT2 this can significantly reduce the number of
candidates we need to actually measure latency on. I beefed up the MockCostEstimator to
make it possible to assert pruning occured from within the test_pass_collage_partition.py
unit test.

The rest of this PR adds the demo_collage_partition.py driver file we've been using
to test and measure perfomance differences against various baseline (though only
for the CUDA ecosystem). To eliminate loading time the models of interest are directly
expressed in Relay text form in menangerie.py.

* - lint
2022-07-15 11:04:33 -07:00
Wuwei Lin e0a0e67e55 [Relay, Op] Add conv2d generic layout op strategy when meta schedule is enabled (#12104) 2022-07-15 16:39:56 +09:00
billishyahao fa057213d4 Enable conv family fused with gelu (#12106) 2022-07-15 16:39:33 +09:00
Tristan Konolige 37f9d3c496 [TVMSCRIPT] Make ceildiv available from tvmscript (#12096) 2022-07-15 09:22:33 +09:00
Josh Fromm c0f4450958 Fix bug that disabled cuda integer dot product. (#12099) 2022-07-15 09:22:17 +09:00
Mark Shields 7661ba8910 [Collage] CollagePartition pass (#12086)
* [Collage] CollagePartition pass

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

This adds the main CollagePartition pass, which:
 1. Inspects all the targets in the CompilationConfig and builds
    PartitionSpecs describing how to generate speculative CandidatePartitions
    for them.
 2. Runs the above rules on the model to collect all the candidates.
 3. Eliminates candidates whose target contradicts any constraints already
    imposed by, eg, device planning.
 4. Eagerly estimates the cost of each candidate.
 5. Performs a shortest path search to chose an 'optimal' set of candidate
    partitions so as to minimize estimated model latency, such that every sub-expression
    node is contained in exactly one candidate partition.
 6. Coalesces adjacent optimal candidates which ended up on the same target.
 7. Rewrites the model according to the chosen optimal partitioning.

As for the existing partition_for_<external codegen name> methods, the result of
CollagePartition can then be built using regular TVM.

Very special thanks to @mbaret for authoring test_pass_collage_partition.py.

Logic to prune the candidates after step 3 will be in a follow up PR since it
deserves its own testing. A demonstration driver will also come as a follow up.

* - lints

* - more lints

* - use the _ffi_api properly
2022-07-14 22:30:44 +01:00
Wuwei Lin e084791852 [MetaSchedule] Add MultiLevelTilingTensorCore rule for auto-tensorization on CUDA (#12059)
* [MetaSchedule] Add MultiLevelTilingTensorCore rule for auto-tensorization on CUDA

Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
Co-authored-by: Hongyi Jin <3231950289@qq.com>

* address comments

* update intrin registrations

* fix tests

* address comments

* add warning when storage align doesn't work

* remove print

Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
Co-authored-by: Hongyi Jin <3231950289@qq.com>
2022-07-14 13:32:11 -07:00
Andrey Malyshev 2fee86e43b [Releay] Fix on_device call for explicit virtual_device (#12088) 2022-07-15 04:21:27 +09:00
Donglin Zhuang f6f90569bc Add tensorflow Einsum op converter (#12064)
* Add tensorflow Einsum op converter

* fix lint

* fix lint
2022-07-14 20:15:41 +09:00
Wuwei Lin a571bfbbca [TOPI] Allow conv definition to have custom kernel layout (#11936)
* [TOPI] Allow conv definition to have custom kernel layout

* add tests

* fix

* fix
2022-07-13 20:42:38 -07:00
Greg Bonik a9c610f1c0 [TVMScript] Add ObjectPath class (#11977)
Motivation:

Same IR node object can be referenced in several different contexts inside a larger IR object. For example, a variable could be referenced in several statements within a block.

This makes it impossible to use an object pointer to uniquely identify a "location" within the larger IR object for error reporting purposes. The `ObjectPath` class addresses this problem by serving as a unique "locator".

Tracking issue: https://github.com/apache/tvm/issues/11912
2022-07-13 16:03:11 -07:00
masahi c30b420f61 [TOPI, x86] Properly handle fused ops in TE softmax schedule (#12015)
* fix x86 softmax fusion

* properly handle the case where softmax and fuseed op having different layout

* add test
2022-07-13 14:08:05 +02:00
Mark Shields b1a3817602 [Relay] Move TOpPattern registration for nn.* to C++ (#12072)
* [Relay] Move TOpPattern registration for nn.* to C++

Some of the Collage machinery is best tested from C++, but
requires Relay ops to have their "TOpPattern" registered.
However since the nn.* ops register on the Python side tests
can't rely on those ops.

The easy fix is to just move the registration to the
RELAY_REGISTER_OP block. However since kOpaque is the
default I did not preserve those registrations.

There's still a few dozen more exotic ops still registered
on the Python side. I've left them be.

* - D'oh! Even kOpaque ops must be registered.
2022-07-12 13:55:24 -07:00
arangasa 6536def6f9 [Topi][Hexagon] Implement Cast F32ToF16 and F16ToF32 Slice Op (#11561) 2022-07-12 13:15:48 -07:00
Qingchao Shen ad44a0fe15 fix some typo in conv2d.py (#12067) 2022-07-13 04:03:59 +09:00
zhaoyang-star ef5c3ed872 [QNN] Use sigmoid Lookup Table method instead of fallback to fp32 (#12038) 2022-07-12 09:58:11 -07:00
zhaoyang-star 6d676badff [QNN] Replace nn.leaky_relu with qnn.leaky_relu (#11930)
* [QNN] Replace nn.leaky_relu with qnn.leaky_relu

* jostle ci

* fix typo
2022-07-12 09:57:54 -07:00
Rafael Stahl 993a8ea094 [Frontend][TFLite] respect out type of Shape op (#11877)
* [Frontend][TFLite] respect out type of Shape op

* tests: update for changes to tflite shape handling

* lint fix
2022-07-12 09:57:17 -07:00