Commit Graph

2329 Commits

Author SHA1 Message Date
Andrew Reusch ee052dd642 Introduce Model Library Format export format (#7533)
* Introduce Model Library Format export format.

 * This function produces a stable on-disk representation of TVM's
   compiler output.
 * It's intended just for use with the C runtime for microTVM right
   now. It could be expanded for other use cases.
 * This PR implements the Model Library Format RFC, which ultimately
   is intended to support the Project Generator API (RFC
   forthcoming).
 * There may be some changes to the format without revving the version
   number until downstream consumers are known. The Project Generator
   API is the first such known downstream consumer.
 * There are no plans currently to support generating old Model
   Library Format from TVM. The version number is intended as a
   compatibility check between the generator and downstream consumers.
2021-03-10 10:22:20 -05:00
masahi a0656f5c40 [SPIRV] Minor update to TIR sort to make it work on VK/SPIR-V (#7607)
* sort started to working

* static size sort seems to be working

* test sort on vulkan

* add nvptx to sort test too
2021-03-09 09:27:02 -07:00
Cody Yu dfc231c97b [Bugfix][AutoScheduler] Correctly resume status (#7614) 2021-03-09 05:38:13 -08:00
Tristan Konolige 89bafd58c2 [RUNTIME] Unify load params interface (#7559) 2021-03-08 21:40:38 -08:00
Chao Liu b827845b11 [Relay] add ShapeFunc for one_hot op (#7490)
* [Relay] add ShapeFunc for one_hot op

* fix pylint

* add test for shapefunc of one_hot op
2021-03-08 13:37:36 -07:00
LiangLiu 8d1f5b238a [Relay] Fix relay op strategy for cuda dense int8 (#7586)
* [Relay] Fix relay op strategy for cuda dense int8

* Remove uint8 && Add autotvm task extraction test for relay graph that contains dense op (int8 * int8 -> int32)

* Reformat the code of test case
2021-03-08 10:54:06 -08:00
Chao Liu ca303aa11c [Relay] add ShapeFunc for tanh (#6898)
* add ShapeFunc for tanh

* _schedule_dense_small_batch turn autotvm off when dense's inner dim is unknown

* fix CI pylint
2021-03-08 10:50:56 -08:00
masahi 760e9b2b04 [Torch, QNN] Support quantized mobilenet v3 from torch 1.8 (#7606)
* [Torch] support hardsigmoid

* qhswish first impl

* add qhardsigmoid but the result is not correct

* add qmv3 to test

* comment fix
2021-03-08 12:37:23 +05:30
Huang, Guangtai 8aa2a7cdbc [CUDA] BF16 support (#7014) 2021-03-06 18:24:49 +08:00
Altan Haan 875f8ee2a7 [Executor][Bugfix] Properly return and unflatten outputs from GraphExecutor (#7604)
* properly return and unflatten outputs from GraphExecutor

* lint

* cleaner approach, not sure what I was thinking before

* remove unused import

* forgot copyto cpu

* make solution even cleaner using iterator
2021-03-06 18:27:49 +09:00
Matthew Brookhart 69c1c6d92e Move SimplifyConvPad to a new pass and don't enable it by default (#7603)
* Move SimplifyConvPad to a new pass and don't enable it by default

* rename pass

* move files

* fix lint

* adjust test tolerance
2021-03-06 14:36:13 +09:00
Chenfan 0b4f669ed4 [AutoSchedule] Sparse dense tuning support with custom sketch rule (#7313)
* Add sparse dense tuning tutorial

* Add sparse input fusion

* Update the dag to support output fusion

* Update

* Add task input to search_task

* Update

* Add search_inputs to measure

* Lint fix

* Lint fix

* Update

* Update

* Update

* Update

* Add file save load support

* Update

* Update

* Update

* Remove add_task_inputs API

* Update

* Update

* Update

* Lint fix

* Lint fix

* Lint fix

* Lint fix

* Update

* Add example ci_log

* Update

* retrigger ci

* Update

* Update

* Update

* Lint fix

* Lint fix

* Lint fix
2021-03-05 20:53:23 -08:00
Andrew Reusch 7344b6666e Fix autotuning, broken in #7337 (#7566)
* Fix autotuning, broken in #7337

* retrigger CI, because I don't understand how it passed
2021-03-05 13:55:05 -05:00
Ritwik Das 5d5bbfb1ed Support negative axis for gather (#7600)
* Fix negative axis in gather

* Clang Format

* Black

* Empty Commit

Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-251.us-east-2.compute.internal>
2021-03-05 09:16:06 -08:00
Trevor Morris b9adce2c80 [Frontend][MXNet] Fix default value for is_ascend in topk (#7568)
* Use correct default value of False for is_ascend

* Add unit test for default topk is_ascend value
2021-03-05 21:46:43 +09:00
masahi fb06fd8a6d Fix for dynamic batch size conv2d nhwc (#7598) 2021-03-05 21:18:51 +09:00
Cody Yu d5cb3cbdfc [PyTorch] Guarantee data input is the first argument (#7592) 2021-03-04 21:34:18 -08:00
Ritwik Das 83ab23460e Add segment sum Op to relay and 7 corresponding TF Ops , fix scatter_add dynamic bug (#7562)
* Add segment sum Op

* Remove unnecessary

* Documentation

* Black

* Add GPU

* Uncomment

* Add documentation

* Add dynamic tests

* Add TF Op

* Add Sparse Segment Sum

* Add test coverage

* PR Comments

* Int64 tests

* Add SparseSegmentSqrtN

* Add SparseSegmentSqrtNOp

* Deduplicate code

* Add SparseSegmentMean

* Parametrize Tests

* Remove

* Modularize

* Black

* Modularize Code

* Pylint

* PR Comments

* Add scatter add tests

* Remove Test

Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-251.us-east-2.compute.internal>
2021-03-05 04:37:43 +09:00
Jared Roesch 6aae48b378 Fixes for using Python APIs from Rust. (#7085)
* Rewrite the Rust Module API and change some imports causing crashes.

This commit also updates the docs to remove outdated information.

* Renable Python test and remove warnings

* Python test still flaky

* Fix broken module test

* Fix broken test

* Reset test file
2021-03-04 10:43:14 -08:00
Cody Yu 3f5f84d2e2 [AutoScheduler] Querying and sampling in task extraction (#7571)
* [AutoScheduler] Query in task extraction

* trigger ci
2021-03-03 16:09:38 -08:00
Tristan Konolige 73a0b96c64 [RUNTIME] Move Map into runtime (#7570)
* [RUNTIME] Move Map into runtime

This allows us to use Map to store parameters needed at runtime.

* node.{Array|Map} -> runtime.{Array|Map}

* missed some renames
2021-03-03 14:52:54 -08:00
wangxiang2713 980cf80324 compile engine dump tir and shape funcs (#7552) 2021-03-03 17:24:52 -05:00
Alexander Pivovarov 67bba90325 [torch] Add linear operator support (#7569) 2021-03-03 14:45:51 +09:00
masahi cf36aa65de [TIR] Add TIR While node (#7425)
* add while node

* update visitors

* binary search lowering works

* llvm codegen working

* cuda codegen working

* nms updated to use while loop

* add missing upper bound check too

* add mandelbrot test

* add gpu mandel

commit ee2363bf8131830cf0fb112890befd6be6a03f36
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri Jan 29 11:44:02 2021 +0900

    enable extern lib offload for nvptx

* rename test

* run black

* add doc

* add collatz test

* add while + vectorize test

* simplify bin search

* Add special case visit method to storage_access.cc

* disallow while loop inside vectorized loop

* disallow trivial condition since we do not have break

* error out in CoprocSync for now

* error out LiftAttrScope for now

* add placeholder to inject_vpthread

* refactor to use MakeAttach

* handle WhileNode in InplaceOpVerifier

* error out in InjectVirtualThread

* try handle WhileNode in StoragePlanRewriter

* remove WhileNode visitor from storage rewrite

* add while loop storage rewrite test

* update tests

* move test_vectorize_while_fail to  test_tir_transform_vectorize.py
2021-03-02 20:31:05 -05:00
Altan Haan 3a02e0b443 [Pass] Profiling TVM compiler passes (#7500)
* basic pass profiler prototype

* allow enable/disable of pass profiling

* lint

* add example pass profiler usage as test

* render pass profiles to String instead of stdout
2021-03-02 16:44:00 -08:00
masahi 08ea9612dc [Torch] Fix converting torch slice op with dynamic slice length (#7549)
* Fix converting torch slice op with dynamic slice length

* use isinstance

Co-authored-by: masa <masa@pop-os.localdomain>
2021-03-02 11:59:08 -08:00
Siyuan Feng 057a673986 [TensorIR] introduce Block and BlockRealize (#312) (#7553)
Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
Co-authored-by: Hongyi Jin <3231950289@qq.com>
Co-authored-by: Wuwei Lin <wuwei@apache.org>

Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
Co-authored-by: Hongyi Jin <3231950289@qq.com>
Co-authored-by: Wuwei Lin <wuwei@apache.org>
2021-03-01 12:59:32 -08:00
ziheng 26733095f5 [Runtime] Special Memory Scope Support (#7488) 2021-02-28 10:52:16 -05:00
Yanming Wang 485dfd6a3c Fix typo in relay.vm.Executable (#7543)
Co-authored-by: Yanming Wang <yanmwang@amazon.com>
2021-02-28 05:31:29 +09:00
Cody Yu 22ba2c42ac [Torch] Simplify contiguous (#7544) 2021-02-27 15:21:15 +09:00
Alexander Pivovarov 0bbc205c16 [torch] Add narrow operator (#7535) 2021-02-27 12:41:17 +09:00
Alexander Pivovarov e7f0a11f8f Add test_forward_index_put to __main__ (#7542) 2021-02-26 21:28:02 -05:00
Andrew Reusch 0758337b2b Add create_local_debug_runtime to micro exports (#7528)
* Add create_local_debug_runtime to micro exports.

* retrigger CI
2021-02-26 17:31:18 -08:00
Matthew Brookhart 2d5747054c [ONNX]fix datatype on Reciprocal op (#7519)
* fix datatype on Reciprocal op

* clean up test case
2021-02-26 13:05:22 -08:00
Lily Orth-Smith 5c5aea620b [BUG_FIX][TOPI] Allow topi resize to accept more options (#7532)
* Make topi more permissive

* Remove testing stuff

* lint

* Downsampling tests
2021-02-26 14:00:54 -07:00
Ritwik Das 56ac892724 SparseReshape Op (#7477)
* SparseReshape Inital Code

* Done

* Format

* Add empty tests

* Formatting

* SanityCheck

* formatting documentation

* Documentation

* Only Enable CPU

* Add support for CUDA

* Stuff

* Add Dynamic Support

* Parallelize GPU Impl

* Documentation

* Documentation

* Import

* Import

* Remove unnecessary code

* PR Comments

* Schedules

* Tests

* Dtypes

* Black

* Parallelize CPU

* CI error

Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-251.us-east-2.compute.internal>
2021-02-26 09:31:28 -08:00
Alex Wong c46b1876f5 [Torch] Pool ops, convert strides and pool_size to int (#7517)
* Convert strides and pool_size to int

* Make helper function, add test

* Fix lint
2021-02-26 14:37:11 +09:00
Yanming Wang 09b0c8e6f6 [Frontend][Tensorflow] Add unique operator (#7441)
* Initial commit of the unique operator

Add unit tests for unique operator

* Add tensorflow unique op

* Refactor unique to use sort-based algorithm

* Change relay.unique test to run only on cpu

* Change topi.unique test to run only on cpu

* Change range to parallel for parallelizable loops

* Add return_counts option for relay.unique and topi.unique, add pytorch frontend

* Fix pylint

* Patch pytorch frontend

* Initial support of topi.cuda.unique

* Refactor to use ir_builder directly

* Modularize adjacent difference

* Refactor to simplify

* Fix typo

* Combine _unique and _unique_with_counts

* Reuse indices_ptr to remove arange_ptr

Co-authored-by: Yanming Wang <yanmwang@amazon.com>
2021-02-26 10:58:39 +09:00
masahi e664b2ff76 [Torch] Avoid adding unnecessary slicing (#7479)
* simplyfing

* improved fast path for slice

* update rewrite pattern for maskrcnn
2021-02-26 10:40:40 +09:00
Matthew Brookhart 6274a7f56c use checked_type instead of type_annotation (#7522) 2021-02-25 14:36:05 -08:00
Robert Kimball 43b15a8caf Many fixes to get unit tests passing on Windows. (#7431) 2021-02-25 14:27:49 -05:00
Andrew Reusch b1116954f5 Introduce module_loader to AutoTVM. (#7337)
* Introduce code_loader to AutoTVM.

 * Prepares for autotuning with microTVM, and provides extension hook
   for VTA.

* add vta hook

* git-black

* pylint

* Add missing import

* Fix import problem

* add missing import

* rename code_loader to module_loader

* rename remote_kw to remote_kwargs

* black format
2021-02-25 10:27:06 -08:00
Tianqi Chen 772fa6bda3 [PYTHON] Enable proper error message in python package (#7521) 2021-02-25 09:53:41 -05:00
Trevor Morris 9e74f90c94 Support CombinedNMS in TF frontend. (#7520) 2021-02-25 11:47:17 +05:30
Jorn Tuyls 1455536cc2 [BYOC][VitisAI] Fix issue in Vitis AI codegen out tensor names matching & update docs and docker (#7350)
* Fix bug in vitis ai codegen out tensor names matching & update docs & update docker

* Update vitis_ai.rst

* Move gpg-agent package installation to vitis ai core script

* Refactor install_vitis_ai_core script

* Update docs/deploy/vitis_ai.rst

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

* Update docs/deploy/vitis_ai.rst

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

* Update vitis-ai docs pynq/edge setup & adjustements for comments

* Update python/tvm/contrib/target/vitis_ai.py

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

* Reorg Vitis AI dockerfile to make sure gpg-agent is installed before llvm

Co-authored-by: Jorn Tuyls <jornt.tuyls@gmail.com>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
2021-02-24 15:32:03 -08:00
Xingyu Zhou 7f869879d2 [Frontend][Tensorflow] Support range like axis in tf.raw_ops.All for TF 2.x (#7502)
* add TF2.x raw_ops.all axis range support

* apply linting

* fix range() func input
2021-02-24 15:25:44 -08:00
Leandro Nunes 9c5333e038 [TVMC] rename composite target "acl" to "compute-library" (#7508)
* Renames the "acl" composite target to point to the specific
   library it represents
2021-02-24 10:06:41 -08:00
Josh Fromm d425c144ad [Relay][Frontend][Onnx] Fix GEMM converter when C is not a parameter. (#7509)
* Fix onnx gemm with non parameter C.

* Add gemm tests for C.

* Fix formatting.
2021-02-24 15:07:11 +09:00
Andrew Reusch 929717a03a Fix stack overflow when partially-__init__ Node raises exception. (#7481)
* Fix stack overflow when partially-__init__ Node raises exception.

 * If a Node subclass raises an exception and ctypes is in use before
   __init_handle_by_constructor__ is called (or self.handle is
   otherwise set), a Python stack overflow could result. This is
   because the unset handle slot causes self.handle accesses to
   fallback on the getattr(self, 'handle') method, invoking
   NodeGetAttr.
 * Then I believe this causes an infinite loop.
 * The fix is to make Node.__getattr__ raise AttributeError for all
   attributes in __slots__, then make __del__ tolerant to missing
   self.handle.
 * I don't believe cython is affected because it implements a
   descriptor to access its underlying chandle and that shouldn't be unset.

* black format

* actually use handle instead of self.handle
2021-02-23 18:29:07 -05:00
Andrew Reusch 0ba37411aa [CRT] Create C-runtime-style metadata module for llvm builds (#7398)
* Create C-runtime-style metadata module for llvm builds.

* maybe address manupa's comment

* lint

* actually address manupa comments

* comment and rename

* git-clang-format

* pylint

* cpp warning

* try to fix apps/bundle_deploy

* black format

* build correct file

* Use save() for C++-runtime targeted artifacts.

* fix build_module LLVM metadata module conditions

* fix test comment

* black format

* further restrict CRT MetadataModule creation

* Fix test_link_params

* black format and address zhiics comments

* fix test_link_params, i think?
2021-02-23 09:54:43 -08:00