* Revert "[skip ci] Revert "[ci] Default to n=2 for test parallelism (#12376)" (#12413)"
This reverts commit 478b672f2b.
* [ci] Default to n=2 for test parallelism
This is attempt #2 of #12376 which was reverted in #12413. The changes
in `plugin.py` should keep all the tests on the same node so sporadic
failures don't happen due to scheduling.
Co-authored-by: driazati <driazati@users.noreply.github.com>
In similar fashion to the conversion of mul to depthwise, this commit
converts add when one input is a constant of shape [1, ..., n] to a
depthwise convolution. If neither input is a constant, the add is
offloaded naturally like before.
The addition testing has been improved to use pytest features.
* working in parralel using worker
* creating launchers per test and clean up
* clean up
* ci change to distrube tests
* ci work with any number of devices
* fix running on simulator
* adding function docstring
* fix android_serial_number to always return a list of string
* lint issue
* fix internal error when skipping tests while androideserial number is not set
* lint issue
Multiply can be supported when offloaded to the NPU by a conversion to a depthwise convolution operation. This is only supported when the multiply operation has a single single variable input with the other being a constant of shape [1, ..., C]. This commit adds a new pass "ConvertEquivalents" (name subject to change) to handle this conversion before codegen.
Hi, this change wants to add some minor updation to region estimator used by buffer compaction:
- Add and clearify among `EstimateRegionStrictBound`, `EstimateRegionLowerBound` and `EstimateRegionUpperBound`
Originally we have `EstimateRegionLowerBound`, actually it implements strict bound estimation IMO. Now add `upper` and `strict` version for where we actually want them.
- When estimating upperbounds (eg. in buffer compaction), try estimate each dimension independently when they are dependent accesses where `EstimateRegionLowerBound` is expected to fail.
Eg, `A[i, i], 3 < i < 16` fails via `EstimateRegionLowerBound` who check indices be independent. But we can still try best to invoke strict bound analysis on each dimension individually.
- If range->extent == 1 for `EvalSet(range, dom)`, invoke `EvalSet(range->min, dom)` instead.
Eg, `EvalSet([k*k, k*k+1), dom_k)` results to [-inf, +inf] due to current algorithm limitation but `EvalSet(k*k, dom_k)` results to a range which makes more sense.
`compute_cycles` can be the size of an int64 value, however it seems
that when that value is attached to the IR as a pragma from Python,
it is interpreted as an `int`, rather than `int64_t`. This commit adds
an explicit cast to ensure the value is interpreted correctly.
The reason these values started appearing very large and randomly is
still yet to be solved, although the hope is that this fix will unblock
CI.
Change-Id: Idcdd7d37af1acd665590c87624446a025b50eb3d
* Fix numerical instability for log sigmoid
Fix numerical instability for log sigmoid in pytorch frontend
* update
* add test for overflow check
* merging two tests
Currently, AutoTVM's ApplyHistoryBest class does not support loading tuning logs from memory. This is a pet peeve of mine, as it requires you to work with a tempfile whenever writing autotuning tests. This is also just strange, as the rest of AutoTVM has support for text buffers (e.g. tvm.autotvm.callback.log_to_file supports passing in a text buffer, letting us write to but not read from them).
Additionally, ApplyHistoryBest handles input arguments very unintuitively. Before this PR, it allowed users to pass string filepaths, a list of string filepaths, or an Iterable (such as a list) of input and result tuples. However, it did not support taking in StringIO objects as mentioned above, nor pathlib.Path objects, nor combinations of a filepath and an Iterable of tuples.
In a perfect world, we would change ApplyHistoryBest to take as input a path-like object, file-like object, or an Iterable of input and result tuples (similar to what ApplyGraphBest takes as an argument). However, this would break the existing functionality to take as input a list of filepaths.
To be backwards compatible, while fixing this issue, this pull request defines a new type inside dispatcher.py:
Records = Union[
Union[str, bytes, Path], # Path-like objects
TextIOBase, # File-like objects
Iterable[Tuple[MeasureInput, MeasureResult]],
]
It then rewrites ApplyHistoryBest.load so it takes the following arguments:
def load(self, records: Union[Records, Iterable[Records]]):
This PR also adds unit tests for this new functionality, and fixes a relevant bug in tests/micro/common/test_autotune.py in which a StringIO object was passed to apply_history_best, causing it to appear to pass but not actually read any data.
This pr fixes the tests that will be broken when we will update TFLite to
the 2.9 version.
We will update TensorFlow and TFLite versions to 2.9 so that we can
benefit from improvements in packaging to support multiple platforms
and Operating Systems.
* Replace microTVM static fixtures with parameterization
* [microTVM] Only perform parameterization when fixture is present
* Reformat with black
* Fix Cortex-M tests
* Add docstring to pytest_generate_tests
* Remove trailing space from docstring
* [TIR] Add pass to check for out of bounds memory access
This is a conservative static analysis that checks to see if any out of
bounds array access occurs. It is not enabled by default.
* formatting
* manually construct local irmodule
* update comment
* fix bug in int_set
There was a flaw in uma_lower (see issue #12410) that lead in some case to a different argument ordering of the cached_func and the Relay function. This results in an incorrect lowering of the primfunc and eventually a wrong result of a run-time error, in some cases.
This commit adds code to correct the described misbehavior and a unit test case to check this end-to-end functionality with a TFLITE model.
* Add optional consumer blocks to cache_read.
* remove comments
* Fully functional
* Add test for consumer targetting.
* Formatting.
* Add missing parameter comment.
* Fix comments
* Simplify type of consumer_blocks in python.
* Change how consumer_blocks is printed in python.
* [TIR] Support AllocConstantNode in CreatePrimFunc
* Handle AllocConstantNode in LeafBlockRemovalPlan
* Properly handle AllocConstNode in BufferAllocationLocator
* handle AllocateConst in EstimateFlops
* remove NDArray printing
* doc update
* add test
* cpplint
* Removed dependency on link-params attribute from target
* Restored NDArray printing to unbreak test
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>