Commit Graph

29 Commits

Author SHA1 Message Date
Karl Koscher 7433b2fd41 Add optional mem_scope parameter to tvm.nd.array and tvm.nd.copyto (#11717) 2022-06-17 14:28:13 +09:00
Alan MacDonald 5b3cef30f9 [microTVM][zephyr] Add support for host-driven AoT execution on zephyr (#11650)
* - add support for host-driven AoT execution on zephyr;
- add initial version of reference counting to prevent python code from inadvertently freeing tensors during garbage collection;
- add support for numerical indices to host-drive AoT get_input();
- add two initial tests for host-driven AoT execution on zephyr;
- rename existing zephyr AoT exec. test;

* address PR feedback

* increase stack size to accommodate qemu_riscv64 stack usage
2022-06-14 15:28:25 -07: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
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
Xiyou Zhou e05a62ba7c [Minor] Typo Fixes (#10000)
* Fix typos.

* Missed funtion -> function.
2022-01-21 10:26:09 +08:00
wangxiang2713 d3d7e8eb6c [PYTHON][FFI] Skip numpy.ascontiguousarray if C_CONTIGUOUS == True (#9073) 2021-09-24 09:22:55 -04: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
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
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
Haichen Shen fbfeee4ccb [Refactor] Rename TVMContext to Device (#7721) 2021-03-26 07:56:57 -04:00
Huang, Guangtai 8aa2a7cdbc [CUDA] BF16 support (#7014) 2021-03-06 18:24:49 +08:00
ziheng 26733095f5 [Runtime] Special Memory Scope Support (#7488) 2021-02-28 10:52:16 -05:00
Tianqi Chen c6f18250e1 [CI] Introduce all platform test for windows/mac/linux. (#6756)
This PR introduces a minimal set of test cases that
are supposed to run in all platforms during CI.

The set of testcases are supposed to help on
platform dependent regression.

See tests/python/all-platform-minimal-test/README.md for guidelines.

- Enable windows mac LLVM build via conda with cython support.
- Test on all platform test cases.
- Update implementation to improve MSVC support.
2020-10-25 19:27:29 -04:00
Jared Roesch f13fed55cf [Format] Convert all Python code w/o CI (#6448)
* Add black setup

* Tweak pyproject.toml

* Fix syntax issues

* Fix

* Tweak

* Black all Python code
2020-09-11 22:17:24 +09:00
Tianqi Chen 8a98782cdf [REFACTOR] Separate ArgTypeCode from DLDataTypeCode (#5730)
We use a single enum(TypeCode) to represent ArgTypeCode and DLDataTypeCode.
However, as we start to expand more data types, it is clear that argument
type code(in the FFI convention) and data type code needs to evolve separately.
So that we can add first class for data types without having changing the FFI ABI.

This PR makes the distinction clear and refactored the code to separate the two.

- [PY] Separate ArgTypeCode from DataTypeCode
- [WEB] Separate ArgTypeCode from DataTypeCode
- [JAVA] Separate ArgTypeCode from DataTypeCode
2020-06-04 15:04:17 -07:00
Tianqi Chen f272e06095 Remove deprecated opengl files (#5711) 2020-06-01 17:53:33 -07:00
Tianqi Chen cdc7ae492e [WEB] WebGPU support (#5545)
This PR introduces WebGPU support to tvm.
The WebGPU runtime is directly built in javascript(as WebGPU uses JS as the first class citizen API)
and exposes back to the tvm's runtime via PackedFuncs.

One important note is that `ctx.sync` is not async.
This is due to the fact that WebGPU is a purely async API and we cannot block in the web environment.

So the current best way to use the js api is to wrap things in an async function.
When copy a GPU array to CPU, `await ctx.sync()` need to be called to wait for copy completion.

We use a AsyncIO rpc server to serve the async functions to the clients.
2020-05-09 16:59:18 -07:00
Andrew Reusch 8d72496887 [RUNTIME][uTVM] AutoTVM + uTVM for Cortex-M7 (#5417)
* Prototype for micro TVM.

* Cleanup and sync micro tvm prototype.

* Use /std:c++14 with MSVC.

 * Per tqchen: project has already moved to C++14
 * Presubmit failed for code that built locally on gcc.

* fix ASF lint, and fix add_asf_header too

* Compiles with USE_MICRO=OFF.

* Cleanup TargetPtr and word size representations.

* fix compile warning

* address logan's comments

* address logan and liangfu comments

* address thierry's comments

* address u99127, liangfu, tmoreau89 comments

Co-authored-by: Logan Weber <weberlo@cs.washington.edu>
2020-04-30 10:59:33 -07:00
Tianqi Chen 3cc4971990 [RUNTIME][OBJECT] Introduce static slots for common objects. (#5423)
The _type_child_slots can be used to enable quick type checking optimization
by checking the whether the type index is within the bound.

This PR enables these static slots:

- Introduce a static assert to avoid the scenario when a developer forget to
  _type_child_slots when the field is set for the type's parent.
- Revamp and assign static type index to common runtime objects
- Add a DumpTypeTable call to allow developer monitor the current situation
  of type table and offers suggestions for the slots(ideally the slots equals
  the number of children so there is no overflow.
2020-04-24 12:49:05 -07:00
Krzysztof Parzyszek 02d3a59b96 [RUNTIME] Initial implementation of Hexagon runtime support (#5252)
* [RUNTIME] Initial implementation of Hexagon runtime support

This is only the TVM runtime. The FastRPC libraries, simulator driver,
etc. will be provided in subsequent commits.

* Fix pylint complaints

* Fix some more pylint complaints

* Add link to the Hexagon SDK website

* Extract VTCM marker into a common variable

* Implement device->device memory copy

* Disable unsigned PDs by default

* Ensure that --hvx_length is present in sim_args if HVX is enabled

* Remove the line about clang from README.md

Apparently things work with libstdc++.

* Mention to set USE_RPC=OFF when building libtvm_runtime.so for Hexagon

* Remember to use codegen_hvx in validate_hvx_length

* Add a line about minimum version of LLVM
2020-04-10 21:47:59 +08:00
Tianqi Chen b528acc143 [LINT][PY] Fixes for pylint==2.4.4 (#4849) 2020-02-08 19:45:17 -08:00
Tianqi Chen e0122c0ea6 [REFACTOR][PY][API-Change] Polish tvm.runtime, tvm.runtime.module API update (#4837)
* [REFACTOR][PY-API] Polish tvm.runtime, tvm.runtime.module API update

This PR updates the tvm.runtime to use the new FFI style.

- Remove top-level tvm.module to avoid confusion between runtime.Module and IRModule
- API changes wrt to runtime.Module
  - tvm.module.load -> tvm.runtime.load_module
  - tvm.module.enabled -> tvm.runtime.enabled
  - tvm.module.system_lib -> tvm.runtime.system_lib
- Remove dep on api_internal from runtime.

* Update module.load in the latest API
2020-02-07 09:15:08 -08:00
Just do it 62543d49f4 It's gpu not cpu. (#4832) 2020-02-06 09:25:06 -08:00
Tianqi Chen fc7dd6d701 [REFACTOR][PY] Establish tvm.runtime (#4818)
* [REFACTOR][PY] Establish tvm.runtime

This PR establishes the tvm.runtime namespace that contains the core runtime data structures.
The top-level API are kept inact for now via re-exporting.

We will followup later to cleanup some of the top-level APIs.

* Fix ndarray name
2020-02-05 09:00:03 -08:00