Removes support for driver stack versions older than 22.05
(semantic 3.0.1). Additionally, changes the integration to make
version checks using semantic versioning rather than the previous
year.month versioning method.
This PR adds boolean operators to OperationDoc. This is needed by the TIR expression printing because it has `tir::And` and `tir::Or`.
Tracking issue: #11912
This PR:
- Adds an entry point for the TVMScript Unified Printer
- Adds a helper object class `RootNodeContainer` to provide an injection point for the actual printer implementation to add specialized logic on the root node to print.
Tracking issue: https://github.com/apache/tvm/issues/11912
This PR migrates the existing MemoryDatabase, which is implemented in
python at the moment, to C++. The original intent of having an in-memory
database that does not persist on disk is merely for testing, but as
times go on, we found it useful in production workflow, and thus decided
to migrate it C++ for potentially better performance.
* [Target] Only append default keys if target doesn't have any yet
This allows target parsers to provide their own target keys. Without this
change, the default keys would always be appended, which may or may not
be desirable.
* Add "cpu" to ARM CPU keys
* Add "cpu" to the keys in the mprofile target parser
* Restore the mprofile cpptest, since the "cpu" key is back
* So the -device attribute is actually needed...
* [TVMScript] IRBuilder, IRBuilderFrame base class
This PR introduces basic data structures of the generic IRBuilder
across the codebase.
IRBuilder is a general-purpose IRBuilder that can be used in TIR, Relax
and any other vendor-specific dialects; IRBuilderFrame is where contexual
information as stored in the IRBuilder.
* fix linter
* Update include/tvm/script/ir_builder/base.h
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Added the following operations in TIR:
- `tvm_stack_alloca`
- `tvm_stack_make_shape`
- `tvm_stack_make_array`
Co-Authored-By: yongwww <yongcale@gmail.com>
This PR:
- Adds VarTable for the new TVMScript Printer
Compared to the prototype version, this:
- Removes unnecessary public methods.
- GetObjectName
- GetUniqueName
- Add Frame parameter for `Define` methods. VarTable will add callback to Frame to remove variable when Frame exits.
- Changes DocFactory from `ExprDoc(ObjectPath)` to `ExprDoc()` to simplify var definition.
Tracking issue: https://github.com/apache/tvm/issues/11912
Added a pass to insert local (cache) stage for the shared memory. It's similar to cache read but bypasses the limitation of int set analysis for compacting buffer region by inferring the buffer shape from the loop extents.
For some operations such as `__nop` or `__copy` the measured inference
time is equal to 0. In this case we are in infinite loop and we won't
exit from it. Added new parameter `limit_zero_time_iterations ` which specify the
maximum number of repeats then the inference time is equal to 0. When
we exceed this value then we will exit from a loop.
This implements an initial Target Parser which uses the same logic as
the CMSIS-NN compiler flags to update the features and keys of the `c`
and `llvm` `Target`s.
Refactoring of the CMSIS-NN logic will be in a separate patch.
If the cascader is enabled and the ops in TIR have the cycle
count annotation, enabling the reorder_by_cycles option will
reorder to copies and computes based on a cycle count.
If reorder_by_cycles is enabled, max_copy_movements is ignored.
This pass is currently not part of the TIR pipeline since it
assumes that weights and bias of a compute op are merged into
one constant (which is WIP).
This PR:
- Implement Frame for the TVMScript Unified Printer
Compared to the prototype version, this:
- Removes the dependency of VarTable (SymbolTable) from Frame
- Adds a callback array to the Frame base class so that VarTable can add callback to clean variable when Frame goes out scope
Tracking issue: https://github.com/apache/tvm/issues/11912
* Add annotation pass for device_copy where we get buffers but expect
textures
* Fix issues with running device_copy
* Get rid of extra memory copy
* Fix build after cherry-picking
* Fix lint
* Fix CI
* Apply comments
Co-authored-by: Andrey Malyshev <elvin.nnov@gmail.com>
* Update C++ standard to C++17
LLVM has switched to C++17 in its development branch. Follow suit to be
able to compile LLVM headers.
* Clang 8.0+ also supports -faligned-new
* Make make verbose
* Use CMAKE_OSX_DEPLOYMENT_TARGET to set minimum macOS version (10.12)
* Update llvmdev version in conda to >= 11
Something seems to be wrong with the llvmdev 10.0.0 packages, since the
LLVM unit test fails on Windows. It works fine when LLVM 10 is compiled
from sources.
* Add NameSupply and GlobalVarSupply
* Build GlobalVarSupply from IRModules instead of having it attached to an IRModule.
* Pass GlobalVarSupply when lowering shape funcs
* Partially replace instantiations of GlobalVar with GlobalVarSupply
* Construct GlobalVarSupply from IRModule
* Add tests for supply
* Add documentation for NameSupply and GlobalVarSupply
Co-authored-by: Florin-Gabriel Blanaru <fgb@system76-pc.localdomain>
This adds an ability to print a "diagnostic marker" based on a given ObjectPath. For example, say we are printing a fragment of TIR like
```
for i in T.serial(10):
a[i] = 5
```
and we would like bring the user's attention to the bound of the loop:
```
for i in T.serial(10):
^^
a[i] = 5
```
In this case we would give the doc printer an object path that represents this loop bound, i.e. something like `path_to_underline=ObjectPath.root().attr("extent")`
Tracking issue: https://github.com/apache/tvm/issues/11912
This makes it a normal pytest decorator so it doesn't incur test set up / tear down. This also makes the PR body the source of truth for skipping slow tests or not since it can be confusing sourcing it both from the PR and commit message.