Commit Graph

95 Commits

Author SHA1 Message Date
Mark Shields db5f4fe65c [Runtime] Add 'static_library' runtime::Module (#11442)
(See https://discuss.tvm.apache.org/t/byoc-supporting-cutlass-byoc-with-collage/12796/6 for
context, which in turn is part of Collage (https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md).

This adds a new 'DSO exportable' runtime module representing the contents of a .o file. It
allows external codegen toolchains to yield a result which:
 - Like CSource modules, can be conveyed directly to the final export_library compilation
   step for linking into the final .so and saved to a know location without risk the
   underlying code artifact will be lost.
 - Like DSOLibrary modules, are self contained so that no additional compile-time arguments
   need be conveyed from the CSource module to the final export_library command line

Since this is the third flavor of 'DSO exportable' module, add a Module::IsDSOExportable.

Since adding the above, can't resist also adding a Module::ImplementsFunction virtual and
calling it from TEComplier to check if an external codegen function actually provided the
implementation it promised.

Note:
 - I've left the existing implementation of runtime.load_module alone which
   relinks .o files to .so files.
 - Though also contained in the .o metadata, I require static libraries to always
   carry their list of exported function names.

This is all pretty stop gap pending a good rework of TVM to supoprt the notion of artifacts
and, perhaps, build rules.
2022-05-26 12:26:05 -04:00
Margaret Qian eed21eeff2 [ONNX] Fix cast op to/from bfloat16 (#11171)
* fix cast from bfloat16

* fix cast to bfloat16 test as well

* clean up comments

* lint

* add comment

Co-authored-by: Margaret Qian <mqian@octoml.ai>
2022-05-15 21:34:37 -07:00
Tristan Konolige 90084ab8db [PROFILER] Theoretical roofline models (#11066)
`tvm.analysis.roofline_analysis` adds estimated roofline performance to a
profiling report. The roofline model measures how close an operator gets
to best possible memory bandwidth or FLOP/s depending on whether it is
memory or compute bound. This computation uses the runtime of the
operator along with two numbers extracted from the TIR code: bytes of
memory touched and number of floating point operations. Because these
numbers are extracted from TIR, they may not be 100% accurate. The best
possible memory bandwidth and FLOP/s are measured by running small
programs that are memory and compute bound respectively.

For now, this function only works with llvm cpu targets, but it should
be possible to extend to GPU targets.
2022-05-03 14:54:38 -07:00
Valery Chernov fafabc96c1 [VirtualMachine] Zero copy in set_input when input is DLTensor (#11003)
* method of creating of NDArray from external DLTensor was implemented

* set input without copying for DLTensor source

* code clean up

* update description and comments after review

Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>
2022-04-15 15:31:01 -07:00
Tristan Konolige a6e620937b [RUNTIME] Api to get number of runtime threads (#10896)
* [RUNTIME] Api to get number of runtime threads

Add `tvm::runtime::threading::NumThreads` and `tvm.runtime.num_threads`
as a way to get the number of threads in use by the TVM runtime.

* check if equal to hardware threads or hardware threads/2
2022-04-05 11:24:37 +09:00
Tristan Konolige adcf199294 [PROFILING] Various fixes for profile_function (#10850)
Check that the function to be profiled is actually defined.

Check that the MetricCollector used actually can time the region
requested.

Default to using the module's entry_name instead of "main".
2022-03-31 17:13:28 -07:00
mawnja 2cc0451c28 added surpport for arg type of numeric float16 and testcase, fixed the (#10797)
cierror
2022-03-28 06:14:09 +09:00
Eric Lunderberg ef35acbb96 [NDArray] Update runtime.TVMArrayAllocWithScope to use ShapeTuple (#10728)
`runtime.TVMArrayAllocWithScope` predates the introduction of
ShapeTuple, and its use simplifies the `tvm.nd.empty` function.  The
two modified locations are the only occurrences of the string
"TVMArrayAllocWithScope" in the repository, so no other call sites
should need to be updated.
2022-03-24 13:07:40 -07:00
Eric Lunderberg d9a5f9ec7e [NDArray] Expose NDArray::CreateView to python (#10712)
Modifying the array view is needed for Hexagon targets, in order to
first call `tvm.nd.array` with the physical dimensions, then update the
shape to contain the logical dimensions.
2022-03-24 13:06:11 -07:00
Andrew Reusch d721d320bd [runtime] AOTExecutor implementation and c target code-generator (#10283)
* Add memory pools to Metadata classes.

* Move ShapeToJSON to utils.

* Track returned TensorType from AOTExecutorCodegen.

* Support calling Relay functions with Tuple.

* Expand supported TIR calling conventions to work with C++ runtime.

* Rename MetadataModule to ConstLoaderModule.

* Add runtime AOT executor module.

* Add AOT code-generation.

* Add a runtime Module to mux between .text Metadata and live Metadata.

* Move launch_param to namespace

* Add test of c++ AOT.

* Fix incongruity between kTvmRuntimeCrt constant

* Expand ExecutorCodegenMetadata to include AOT runtime metadata.

* commit cpp test

* Make Metadata compile under C.

* Ignore ephemeral metadata_module export_model_library_format.

 * This module does not need to be exported, since it is merely a C++
   wrapper around get_c_metadata, and get_metadata is not used in C.

* address manupa, kparszsyc, masahi comments.

* further address comments

* clang and python format

* Fix broken test

* Address lingering comments from masahi, kparszyzc
2022-03-03 09:50:55 -08:00
Valery Chernov d62a364ba7 [VirtualMachine] new method allowing to set one input tensor by its index or name (#10293)
* set_input_with_index was implemented for VM

* clean code

* add getInputIndexFromName. add function descriptions. lint fix

* fix lint

* transfer comparison of parameter names number and assigned devices number to VMFunction constructor

* add GetVMFunctionWithName to Executable API

* clean code

* add SetInputWithName (set_input_with_name) to VM API

* join SetInputWithIndex and SetInputWithName to SetOneInputTensor (set_one_input) to VM API, the joined methods were removed

* fix lint

* some fixes after review

* add set_one_input method to python API of VirtualMachine

* pytests for set_input and set_one_input methods of VirtualMachine were implemented and checked

* CI restart

* construct simple model for pytests by relay instead of onnx tools (need for correct CI)

Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>
2022-02-26 05:46:01 +09:00
Tristan Konolige 780f88a425 [FIX,AUTOTVM] Add backtraces to tuning errors (#9901)
* [FIX,AUTOTVM] Add backtraces to tuning errors

Collects tracebacks in LocalBuilder and LocalRunner and adds them to the
error messages.

* formatting

* correctly unpack traceback and exception

* add assert

* fix?

* one remaining measureresult

* formatting

* fixed
2022-02-01 14:20:42 -08:00
Masahiro Masuda 1b9b05e61d [CUTLASS] Profile only the largest-possible alignment by default (#10036)
* introduce profile_all_alignments option

* add profile_all_alignment option to API

* wip

* fixed dynamic case

* black

* update gen_gemm too

* minor improvement

* fix

* all tests work

* add doc

* fixed for sm = 75 case

* fix typo

* remove unused import

* profile_all -> find_first_valid

* fix
2022-01-26 15:42:54 +09:00
Krzysztof Parzyszek 751f83b565 Auto-discover C/C++ compiler instead of hardcoding g++ (#10007)
Some platforms (e.g. FreeBSD) use clang as the default OS compiler,
and there is no g++.
2022-01-21 13:25:08 -08:00
Xiyou Zhou e05a62ba7c [Minor] Typo Fixes (#10000)
* Fix typos.

* Missed funtion -> function.
2022-01-21 10:26:09 +08:00
Philipp van Kempen cc5382ed41 Add runtime.ModuleGetFormat method enabling export of BYOC generated sources which require a .cpp/.cc file extension (#9243)
* Allow export of C++ kernels using correct file extension

* [WIP] Set module_key=c for CSourceCrtMetadataModuleNode to temporarily fix failing tests

I realized that the module format `cc` is currently already used by the `CSourceCrtMetadataModuleNode` declared in `src/target/source/source_module.cc`.
This needs to be discussed first to decide if either the module_key should be changed or the test cases expecting the systemlib kernel (e.g. `default_lib0.c`) to have a `.c` extension.

* Update Makefiles used by tests/python/relay/aot/ to support C++ file extensions

AOT: Add c++ support to aot_test.mk
AOT: Add c++ support to corstone300.mk

* Add missing definition of GetFormat to cmsisnn and ethosn codegens (WIP)

* Resolve PR comments

* lint python/tvm/runtime/module.py

* fix EthosUModuleNode for CI

* Fix: detect empty module.format

* Add error message to assertion

* Lint python/tvm/runtime/module.py
2022-01-20 06:48:07 +09:00
Colin Y. Li f9d8c2b996 Add API get_input_info to graph_executor (#9889) 2022-01-13 21:29:50 +09:00
Michal Piszczek 3b85f7c768 [VM] Remove undesired arg to load_late_bound_consts (#9870)
* Remove undesired arg to vm exec load_late_bound_consts

* No-op for ci
2022-01-10 11:06:17 -08:00
Tristan Konolige 8c2360e435 [PROFILING] Add ability to profile a single function_profiling (#9553)
* [PROFILING] Add ability to profile a single function_profiling

Add a new function `tvm.runtime.profiling.profile_function` which
collects performance metrics for a single function in an IRModule. For
example, collecting performance counters using `PAPIMetricCollector`.
This is helpful for optimizing kernels and schedules for a single
operator.

* fix docs

* configurable number of warmup iterations. avoid allocating when stopping collectors
2022-01-10 08:19:21 +09:00
Mark Shields e7b5d2dde8 [Relay] Support large constants saved/loaded outside of VM executable (#9734)
* [Relay] Support large constants.

This allows constant tensors at or above a given byte limit to be marked as
'late bound' and saved/reloaded to a file independently of the overall
executable. Since the executable is often embedded in the data segment of
generated runtime Modules this avoids problems with external tools which can't
handle multi-gigabyte data segments.

[ACE-466 in OctoML JIRA]

* [checkpoint] fix latent bytecode/code bug
2021-12-14 22:38:41 -08:00
Manupa Karunaratne c22d80d44e [microNPU] Move the compilation to use Target Hooks. (#9597)
* [microNPU] Move the compilation to use Target Hooks.

This commits moves the current compilation flow
to use target hooks, so that the generated TIR
is provided to unified module to for unified
optimizations.

Change-Id: Ib3239a04ab201748e7f1b1ffa503cfe2aa7ccb7b

* [microNPU] Move the compilation to use Target Hooks.

*Fixing unpacked API tests
*Adding use_device_api target attr to example target hooks

Change-Id: I72c51caa57e9a0c2a538f40eb73939e28d4f112f

* [microNPU] Move the compilation to use Target Hooks.

* Modifed CLZ test case to support target hooks
* Modifed reference TIR for test to include allocate annotation
* TIR to CS translation tests are modified to run MakeUnpackedAPI

Change-Id: I3a3d28777a6995e7f2b8789e14c5cb0f280dc763

* [microNPU] Move the compilation to use Target Hooks.

* Added a missed documentation to changes in source module
* Skipping device api test for packed API as microNPU does not
  support it.

Change-Id: I6da1adcf8fdd3f972ec9b37ff530ff673e93058c

* [microNPU] Move the compilation to use Target Hooks.

* fixed tvmc test use unpacked-api for microNPU compilation

Change-Id: Ib722d91ca3b3e4c6d13075ee0873acb86f487247

* [microNPU] Move the compilation to use Target Hooks.

* adjust target name.

Change-Id: I862957324440705fb6093939b97b1a00fa1d4b46

* [microNPU] follow up on using target hooks

* Fixed few typos and cleaned up as per suggestions

Change-Id: I2a744a4bc4015e1884dbef4165252aa13aa30b31

* [microNPU] follow up on using target hooks

Fixing some typos and change params to
const_dict as it seems more clearer

Change-Id: Ia36a4635a68f6490bcc3eeaa72eeeeaadb6aa7f6

* [microNPU] Move the compilation to use Target Hooks.

Fixing up lookup table tests to use new runtime module
import structure resulted from using target hooks.

Change-Id: I250aedef7cc73edad3812bb7e9aab013ed8bed5b
2021-12-01 15:44:34 +00:00
Mark Shields 3047709f2a [Relay] Use LowerTEPass in VM (#9483)
We replace use of the TECompiler::{Lower,LowerShapeFunc} methods from the VM's
compiler.cc with LowerTEPass. This clears the way for performing post-lowering
IRModule->IRModule transformations which combine Relay and TIR analysis. In particular,
it will allow us to use the PlanDevices pass to propagate memory scope constraints
across PrimFuncs.

We run LowerTEPass fairly early in the pipeline, which required quite a few passes
to become 'post-lowering friendly'. In particular, ManifestAlloc is now run after
rather than before lowering, and so must now work in a mixed Function/PrimFunc world.

The "vm.shape_func" operator has been removed since a) lowering has already generated
the necessary dynamic shape function, and b) the call to that function can be
represented by an 'ordinary' vm.invoke_tvm_op call.

We worked our way through the following glitches:
 - Dynamic shape functions are now given their true type (rather than the type of
   the primitive function they are paired with).
 - Lowering was choosing definitional GlobalVars which were not pointer-equal to the
   referential GlobalVars left behind in the rewritten Calls. We fixed that in
   te_compiler.cc, though better would be to push GlobalVars deeper into the
   lowering machinery.
 - device_copy was rewritten to a call to @__copy without any definition. Though we
   tried adding it as a global this (obviously in retrospect...) won't typecheck if
   there are multiple device_copies in the program. Instead leave device_copy unchanged
   during lowering and update each executor codegen to look for them specially.
 - Calls to already-compiled BYOC functions were indistinguishable from calls
   to (non-primitive) Relay functions. We move them into the call_lowered calling
   convention, and leave behind a Function tagged with "ExternalSymbol". Better would
   be a first-class representatn for externals in the IRModule but one step at a time.
 - Functions with dynamic shapes tagged for BYOC compilation were not tracking their
   connection to their dynamic shape function. We now use exactly the same attributes
   as for non-BYOC primitives.
 - VerilatorRuntime can legitimately be deleted before initialized.
 - IRModule attributes must be preserved. In particular, since LowerTEPass can
   be invoked more than once we need to be careful to preserve any existing external
   modules and other attributes gatherd from an earlier LowerTEPass.
 - GetUniqueName accounts for existing definitions in the module, but is not used
   for external functions since their intended names are communicated to the codegen
   toolchain via the already fixed "global_symbol" attribute.
2021-11-30 23:15:07 -08:00
Mark Shields 289bd90cfc Prepare for switching VM to LowerTEPass. (#9550)
This is a grab bag of fallout changes from switching the VM to use LoweTEPass
which can be easily split out of the main #9483 PR.

- AnnotateSpans can be used from C++ (though, unfortunately, it didn't help
  me with debugging since spans are universally dropped in most passes).
- Can get a human readable dump of the VM's PackedFunc names and indexes for
  debugging.
- If TVM_LOG_DEBUG defined then include types and ids of GlobalVars. I had
  a lot of difficulty tracking down where duplicate GlobalVars for the same
  name_hint were getting created and propagated.
- GetCallLoweredProps follows same API as GetDeviceCopy and GetOnDevice
  where will return 'null' properties if call/expr is not of call_lowered
  form. Mildly more convenient, though switching all the above to ICHECK
  and push 'if (op == the relevant op)' into all use sites would also be just
  fine.
- Misc VLOG improvements made while tracking down issues in #9483.
2021-11-24 17:09:53 +00:00
Mark Shields be03d62e5b Switch PlanDevices pass to be w.r.t. SEScopes instead of DLDeviceTypes. (#9326)
* Switch PlanDevices pass to be w.r.t. SEScopes instead of DLDeviceTypes.

CAUTION: Breaking VM executable serialization change. I needed a new 'virtual devices' array in the executable so that instructions can continue to refer to devices by a simple index yet the VM can respect both the device type and id for runtime devices.

Continuing from #9313, and as part of apache/tvm-rfcs#38, we switch PlanDevices to plan with respect to SEScopes instead of just DLDeviceTypes. Our ultimate goal is to be able to flow memory scopes between PrimFuncs by re-running PlanDevices after the LowerTE pass. This PR at least gets us to being able to flow the memory scopes, but the actual changes to PlanDevices to look inside PrimFuncs is still two PR's in the future.

However, we get two nice side effects right away:
 - Since SEScopes contain Targets we can isolate all the device-to-target resolution machinery within PlanDevices (with the help of CompilationConfig). After PlanDevices has run we can retrieve the Target for any sub-expression directly from that sub-expression's SEScope. For now we retain the one-Target-per-DLDeviceType constraint since it baked into the public 'TargetMap' API, but the path to breaking that constraint is clearer.
 - Device ids are now respected all the way from annotation to executor. Previously though we had a bit of plumbing using Devices the device_id therein was ignored or defaulted to zero.

 The Python "on_device" annotation helpers still work w.r.t. devices. Thus though they now respect device ids, they do not allow the user to specify a Target or memory scope as supported by the underlying SEScope.

* [checkpoint] Revert emitter.py, must have run 'black .' by mistake.

* [checkpoint] Address PR comments

Also add back SplitArgs pass in build_module.cc which somehow got lost in the shuffle.

(try again -- flaky test_crt.py test_autotune?)

* [checkpoint] Fix after rebase on CallLowered.
2021-11-12 09:11:12 -08:00
Mark Shields aeff3ea711 BUG: alloc_tensor offset and reshape shape should be on the CPU (#9421)
* BUG: alloc_tensor offset and reshape shape should be on the CPU

The VM ManifestAlloc pass was allocating constants in a few places I
forgot to tag with on_device for the host/cpu. As a result the runtime
would (silently) do the x-device copy, which destroys perf.

To make this easier to spot in the future added a 'constants' property
to the VM Executable to dump the shape & device for all VM constants.

This is CORE-102 in OctoML JIRA.

* [checkpoint] Older compilers can't handle << overload

* [checkpoint] Woops, forgot requires_cuda
2021-11-03 06:22:32 +09:00
Lunderberg 1526ad1f61 [UnitTest][Flaky] In test_report_serialization, compare csv. (#9275)
* [UnitTest][Flaky] In test_report_serialization, compare csv.

`str(report)` calls `ReportNode::AsTable()`, which includes aggregate
values.  Otherwise negligible differences in the computed value can be
rounded differently after the round trip.  This was first [noticed in
CI](https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/PR-9194/7/pipeline/#step-246-log-1217)
for an unrelated PR.  Testing locally, this failure mode occurred 2
times out of 3000 trials.

Switching to `report.csv()` avoids this issue, as it does not include
aggregates.

* Switched back to using AsTable(), but with column sums disabled.

The .csv column headers are in arbitrary order, and do not test
whether the `device_metrics` field has been serialized/deserialized
correctly.

* Added explicit sorting of columns to Report::AsTable
2021-10-23 06:25:58 +09:00
Tristan Konolige 37cd9837ff Fix end to end benchmark with rpc devices (#9175)
* Ensure that device used in end to end rpc is a local device

* fix vm; add actually failing tests

* bump roi_align test tolerances
2021-10-05 11:57:35 -07:00
wangxiang2713 d3d7e8eb6c [PYTHON][FFI] Skip numpy.ascontiguousarray if C_CONTIGUOUS == True (#9073) 2021-09-24 09:22:55 -04:00
Junru Shao 4c8531d6a9 [Meta Schedule][M3c] Argument Info (#9059)
This PR is part of the meta schedule project (#8473) that adds metadata of each PrimFunc's argument.
This feature is necessary for dynamic shape auto-tuning.

Co-authored-by: Xiyou Zhou <xiyou@octoml.ai>
Co-authored-by: Bohan Hou <32121147+spectrometerHBH@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: Siyuan Feng <Hzfengsy@sjtu.edu.cn>

Co-authored-by: Xiyou Zhou <xiyou@octoml.ai>
Co-authored-by: Bohan Hou <32121147+spectrometerHBH@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: Siyuan Feng <Hzfengsy@sjtu.edu.cn>
2021-09-22 08:59:54 -07:00
Tristan Konolige c650f9ac15 [PROFILING] Profiling over RPC (#8885)
* [PROFILING] Profiling over RPC

Allow for profiling over RPC by serializing the returned report before
sending it. Also remove collectors argument when profiling over rpc
because it cannot be serialized.

* lint

* fixes

* add comments
2021-09-09 14:53:31 +09:00
Tristan Konolige 55bb8b60b7 [Graph Executor, VM] Add end to end benchmarking of models (#8858)
Add benchmarking that includes ovearhead of transfering inputs and
outputs to and from the device. This should give an accurate measurement
of the runtime a user would see when using the model. This is
accomplished by adding functions that run from inputs to return values
into the graph executor and the VM.
2021-08-27 14:39:03 -07:00
Tristan Konolige f1ca91d4e4 [GRAPH EXECUTOR,VM] Add benchmarking function to graph executor and vm (#8807)
* [GRAPH EXECUTOR,VM] Add benchmarking function to graph executor and vm

This new benchmarking function is just a convenience function for
calling time_evaluator on the underlying module. Hopefully this should
make it easier for users to get good benchmarks of their code.

* formatting

* import order

* more test, more comments, more precision

* fix tests

* add seconds descriptions to doc
2021-08-25 20:25:29 -05:00
Hua Jiang e1bb7ac880 [VM] Add get_input_index support. (#8661) 2021-08-06 17:24:09 +09:00
Chenfan 88dd31b600 [VM] Bug fix for numpy scalar input in vm (#8553)
* Bug fix for numpy scalar input in vm

* Bug fix

* Re-triggle CI

* Update

* Update UT

* Re-triggle CI
2021-07-30 14:11:51 +09:00
Tianqi Chen 3b7aed3263 [FFI] Specifically check handle for recursion during shutdown (#8548)
NOTE: previously slot may get overriden by child class and it
is better to directly check for handle here.
2021-07-27 08:52:49 -04:00
Tristan Konolige bce0db55d7 [PROFILING] Add json output to profiling reports (#8503)
* [PROFILING] Add json output to profiling reports

* format json in comments
2021-07-24 15:57:40 +09:00
Tristan Konolige d67514bd60 [PROFILING] Use PAPI to collect hardware performance counters on CPU and CUDA (#7983)
* [PROFILING] Use PAPI to collect hardware performance counters on CPU and CUDA

This PR adds an optional dependency on PAPI
(https://bitbucket.org/icl/papi/) in order to collect hardware
performance counters on CPU and CUDA. These performance counters include
data like total cycles, instructions executed, and cache misses. Users
can control which performance counters are collected by setting the
TVM_PAPI_${DEVICE}_METRICS environment variable to a semicolon separated
list of metrics.

* Update CMakeLists.txt

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* move thread pool reset out of crt

* add docs

* comments

* formatting

* forgot one doc

* kDLGPU -> kDLCUDA

* Refactor API to more closely match pass instrument's.

* forgot files

* formatting

* more lint

* fix docs

* optional loading of papi metric collector in python

* more formatting

* fix check

* update docs and default value

* formatting

* addressing andrews comments

* fix docs

* address comments

* move shared initialization code into private function

* move most definitions from papi header to implementation file

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
2021-07-13 09:52:44 -07:00
Lunderberg d9fe67259e [Docs] Prevented docs/1 file from being generated. (#8029)
* [Docs] Prevented docs/1 file from being generated.

Typo in tests/scripts/task_sphinx_precheck.sh caused $TVM_HOME/docs/1
file to be created with stderr output, rather than merged stderr and
stdout.

* [Docs] Corrected sphinx build warnings

- Previously, several warnings were generated by sphinx, but were
  unintentionally suppressed.  This PR resolves the sphinx warnings.

* [Docs] Corrected additional sphinx build warnings.

- Rebased on main and corrected warnings, now up to date as of commit
  53e4c603.

* [Docs] Corrected additional sphinx build warnings

- Rebased on main and corrected warnings, now up to date as of commit
  1f2ca068c.

* [Docs] Corrected additional sphinx build warnings

- Rebased on main and corrected warnings, now up to date as of commit
  d0791d3db.

* [Docs] Ignore sphinx warnings from missing "git describe" and sckit-learn versions.

Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
2021-06-24 10:27:29 -04:00
ziheng 4d9bc9b4a3 [RUNTIME] ShapeTuple Container (#8200)
* Add ShapeTuple.

* Update NDArray.

* Documents.

* Lint.

* Lint.

* Lint.

* Address comment.

* Address comment.

* Address comment.

* Lint.

* Lint.
2021-06-10 07:03:15 +08:00
Lunderberg a74d0fef35 [Codegen] Use "target.build.$TARGET_KIND" for all codegen functions. (#8071)
* [Codegen] Use "target.build.$TARGET_KIND" for all codegen functions.

- Removed special case for "micro_dev" target.  Instead, register
  BuildCHost as both "target.build.c" and "target.build.micro_dev".

- Renamed "target.build.build.aocl_sw_emu" to
  "target.build.aocl_sw_emu".  Appears to be a typo introduced in
  #841725cc585

* [micro_dev] Removed references to non-existent micro_dev

device_api.micro_dev was removed in
745e542e4d, but several references still
remained.

Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
2021-06-04 10:34:25 -07:00
Haichen Shen 720e7b1ebd [Refactor] Rename asnumpy -> numpy in NDArray (#8083) 2021-05-21 08:32:27 -04:00
XuanAnyvision 365484e054 allow module exits without del (#8063) 2021-05-18 08:58:56 -04:00
Yuchen Jin 43c2ea72bc Rename gpu to cuda, and bump dlpack to v0.5 (#8032) 2021-05-13 09:11:40 -04:00
Yuchen Jin 8d9a1dfe77 [DLPACK] Support the new python array api with DLPack (#7993)
* [DLPACK] Support the new python array api with dlpack

* Fix lint
2021-05-06 22:51:49 -07:00
Mehrdad Hessar 8c56ce3b90 [Graph Executor Debugger] Fix parameter dump (#7903)
* remove debug mode

* reformat

* format

* address comments

* add single call for all layers

* fix test

* revert

* address comments

* address comments

* fix rerun node

* fix error

* format

* raise error on array()

* fix java

* Revert "fix java"

This reverts commit c4cf952dbc5c9c32d65ef0ca05d6ecbb5c06d5aa.

* bring back for java api

* fix error

* cleanup

* format

* rm redundancy

* add last execution track

* trigger build

* address comments

* format

* fix name overlap

* Trigger Build

* trigger build

* trigger

* trigger
2021-05-03 10:17:05 -07:00
Andrew Liu dc1f189207 [AutoTVM] [TOPI] Support AutoTVM for int4 tensorcore (#7831)
* initial

* int4 asnumpy

* remove

* random test

* format

* random

* remove unused import

* change dist range

* add fuse_pack in

* random engine

* reformat

* remove import

* add cuda context

* refactor code
2021-05-01 16:27:36 +08:00
Y 82fecbfa66 [CodeGenC] Fix bugs when calling extern functions (#7911) 2021-04-26 08:28:35 -04:00
Tristan Konolige bd2520fdae [PROFILER] Add CSV output to profiler (#7797)
* [PROFILER] Add CSV output to profiler

This patch changes the profiler output from a string to a Report object.
A Report can either output CSV or the usual human-readable table.

* no spaces after commas

* Update src/runtime/profiling.cc

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* fix gcc

* fix test

* overall percent fix

* rename overall -> device_metrics

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
2021-04-20 10:21:54 -07:00
Tristan Konolige f57830bd8b [FIX] Fix RPC for the VM (#7810)
* [FIX] Fix RPC for the VM
2021-04-15 11:03:27 -04:00
Tristan Konolige b95803faf6 [Profiling,VM] Profiling interface for VM and Graph Runtime (#7624)
* [Profiling,VM] Profiling interface for VM and Graph Runtime

* lint

* fix test

* make profiling test actually run

* Try to better match the graph runtime function names to vm

* formatting

* DurationNode.value -> microseconds; PercentNode.value -> percent; make frame sorting optional.

* renaming for the tvmcontext -> device change

* formatting

* remove old vm profiler get_stat api

* fix tests
2021-04-01 09:34:33 -07:00