Commit Graph

3663 Commits

Author SHA1 Message Date
billishyahao d0da0b94de Fix typos in target warn of dnnl (#11678) 2022-06-10 22:49:50 -07:00
Wuwei Lin a8d60392ba [TIR] Register CUDA WMMA tensor intrinsics (#11677)
* Register CUDA wmma tensor intrins

* Meta programming to generate wmma intrin

* format

* fix

* fix wmma_store

* lint

* Update cuda.py
2022-06-11 13:16:47 +09:00
Mark Shields dfc8e95604 [BYOC] Make CUTLASS BYOC integration 'Collage friendly' (#11631)
* [BYOC] Make CUTLASS BYOC integration 'Collage friendly'

(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).

Currently CUTLASS has four entry points:
 - The usual 'partition_for_cutlass' partitioning function, using the
   standard pattern table and pass machinery (see cutlass/build.py).
 - A 'tune_cutlass_kernels' function which augments CUTLASS partition
   functions with the results of building and running test kernels (see cutlass/build.py).
 - A 'relay.ext.cutlass' external codegen function which inspects the
   turning results and generates a CSourceModule for each partitions
   (see cutlass/codegen.cc).
 - A 'build_cutlass_kernels_vm' function which runs 'export_library' with
   all the nvcc compiler options needed to build all the CSourceModules
   (see cutlass/bild.py).

For Collage we'd like CUTLASS to have only two entry points: 'partition_for_cutlass',
and 'relay.ext.cutlass' or equivalent. This makes the CUTLASS external codegen integration
composable with other integrations, which in turn helps Collage avoid having to understand any
external codegen APIs other than the global pattern table and the custom compilation function/pass.

Collage also tends to end up requiring multiple partitions for the same backend since it is
more aggressive at mixing-and-matching smaller sub-graphs between backends. Thus we'd also like
to make sure all tuning, generated code and compilation overhead is shared between all such CUTLASS
partitions.

So, in this PR:
 - We add all the CUTLASS-specific tuning and compilation options as new Target
   attributes for the 'external codegen' "cutlass" TargetKind (cutlass/target.cc).
   The user now has one place to provide those settings, and we've already done the
   legwork to plumb the target instance.
 - We replace 'relay.ext.cutlass' with a 'RelayToTIR' custom pass hook
   'CompileForCutlass' (see cutlass/codegen.cc). This pass obviously can see all
   the CUTLASS partitions in the IRModule, so we can now share tuning results
   between them all and can be sure to generate a single CSourceModule. The pass can
   also invoke the compiler to yield a StaticModule, which we've also already done the
   legwork to support. In this way all CUTLASS-specific steps are handled at once.
 - For convenience we supply 'finalize_modules' and 'finalize_modules_vm' which
   invoke nvcc for final linking (using export_library as usual). However, there's now
   nothing CUTLASS specific in those helpers other than their overriding of the 'compiler' to
   be nvcc.
 - test_cutlass.py is updated to use the new API.

 Though this is a breaking change for existing users of the CUTLASS integration the
 change is pretty minor, as shown in test_cutlass.py.

* - Masa's comments

* - Remove unnecessary save.
2022-06-11 11:52:29 +09:00
Kathryn (Jinqi) Chen 50c6a9896d [MetaSchedule] Generate MetaSchedule Dataset (#11641)
In order to build a dataset for improving the cost model for MetaSchedule, I added several files
including importing models to TVM, extracting tuning tasks, and sampling measure candidates.
Meanwhile, I exposed some methods in C++ to the Python side to assist the process.
2022-06-10 18:15:05 -07:00
Tristan Konolige 7de8980f24 [FIX,METASCHEDULER] Fix tune_te (#11676)
`tune_te` was broken because it passed a primfunc to `tune_tir`. Now it
is wrapped in an IRModule. Also the test is re-enabled.
2022-06-10 18:14:00 -07:00
Qianshui 705993e485 [DNNL][CBLAS][BYOC] Unifles all MKLDNN/DNNL to DNNL (#11638)
* unifies all MKLDNN/DNNL_CODEGEN to DNNL

* translate -lib=mkldnn to -libs=dnnl in target

* type check added before

* rebase and update conv2d from mkldnn to dnnl
2022-06-11 08:47:40 +09:00
billishyahao e8712a9198 [BYOC][DNNL] Improve performance of DNNL BYOC dense operator (#11513)
* Enhance dnnl byoc dense operators performance by 1) introducing gelu fusion and 2) introducing alter dense weight layout.

* fix lint issue

* add unittest for dense pack

* Make code compatible after introducing TensorRequisite(PR-11345)

* Fix comments & refactor code

* Fix lint

* Fix partition graph unittest case

* Fix comments

* Fix comments

* Fix lint
2022-06-11 08:45:18 +09:00
Mehrdad Hessar dc522a6ff6 [Hexagon] Run single RPC server on Android in each testing session (#11547)
* Reuse hexagon launcher in test session

* separate random name generation

* revert get_aot_executor

* Fix launcher for simulator case

* add stop server for simulator
2022-06-10 16:33:24 -05:00
Nicola Lancellotti e7f793d0ad Add assert message (#11665)
Change-Id: I88f19c7105cce048d2f52d50450a551fb12162dc
2022-06-10 17:31:13 +01:00
Qianshui f117244ac4 [DNNL][Relay extern-schedule] DNNL Conv2D Kernel enable by assigning "-libs=mkldnn" (#11571)
* enable oneDNN conv op by using -libs=mkldnn

* add channel last format support and let oneDNN chose blocked format.

* remove unnecessary changes

* reformat 3 files

* reformat 1 file

* change the argument name

* change the argument name

* rename the arguments

* fix cpp lint issue

* fix cpp lint issue

* fix cpp lint issue

* clang reformated

* adjust .py import for testing

* function existence check in test
2022-06-10 20:59:09 +09:00
Junru Shao 6fca5c657a [MetaSchedule] Developer Ergonomics Enhancement (#11622)
Per discussion with @Kathryn-cat

- [x] Move `initialize_with_tune_context` as private API `_initialize_with_tune_context`, and
encourage using `TuneContext.initialize`
- [x] Instead of using bunch of import statements, encourage using `ms.xxx` as the prefix
(e.g. `ms.database.MemoryDatabase`) to organize things better
- [x] Move `DefaultLLVM`, `DefaultCUDA` to a separate file and make them more discoverable
- [x] Move `DummyDatabase` to `tvm.meta_schedule.database.MemoryDatabase` given it's actually useful
- [x] Delegate class members' methods in `TuneContext`, for example, having
`TuneContext.generste_design_space` from `TuneContext.space_generator.generste_design_space`

Next PR:
- Allow using a string `"default"` in `TuneContext` as well as `tune_relay/tir/te` to quickly
specify a set of target-specific rules
- Add `TuneContext.tune` to allow directly tuning without task scheduler.
- Enhance detection of `ScheduleFn` in `TuneContext` to make it easier for users to quickly try out
template-driven scheduling on TIR.

Co-Authored-By: Kathryn (Jinqi) Chen <65606304+Kathryn-cat@users.noreply.github.com>
2022-06-09 22:09:40 -07:00
Masahiro Masuda 53d163c968 [TIR, CUDA] Add pass to replace global to shared memory copy with cp.async (#11658)
* [TIR, CUDA] Add pass to replace global to shared memory copy with cp.async

* add missing doc

* black

* missing src

* clang format

* clang format

* check against nested async scope
2022-06-09 19:05:18 -07:00
Tristan Konolige fe299d7688 [TVMSCRIPT] Improve tvmscript type hints (#11654)
* [TVMSCRIPT] Improve tvmscript type hints

- Change numeric types to classes so they work as function arguments.
- Add var as a class.
- Add floordiv, index, and mod to PrimExpr.

* use Union
2022-06-09 17:45:36 -07:00
Gavin Uberti 762bed0d0d [microTVM] Add support for Arduino Portenta H7 (#11636)
* Add support for Portenta H7

* Add Portenta H7 to supported boards in README

* Rerun tests
2022-06-10 08:58:35 +09:00
Eric Lunderberg af0128158c [TIR][Schedule] Allow named block and buffer arguments in Schedule (#11624)
* [Schedule] Allowed string argument as block arg

This has previously been implemented for `Schedule.transform_layout`
in https://github.com/apache/tvm/pull/11296, extending to allow for
block arguments in all `Schedule` methods.

This change was only made for arguments that must be a `BlockRV`.  For
arguments that may be either a `BlockRV` or another
type (e.g. `Schedule.get_child_blocks` accepts either `BlockRV` or
`LoopRV`), this sugar is not implemented, to avoid ambiguity.

* [Schedule] Allowed string argument to Schedule.reindex

Similar to https://github.com/apache/tvm/pull/11269, which added this
functionality to `Schedule.transform_layout`.

* CI test update
2022-06-09 13:34:32 -07:00
czh978 f528a9a1cd [Frontend][TFLite] Improve support for half_pixel_centers in resize (#11521)
* add resize_nearest_neighbor op test

* Improve support for half_pixel_centers in resize
2022-06-09 10:33:44 -07:00
Sunghyun Park 87502ddd90 [PASS] Refactor a couple of TIR passes - BindTarget, AnnotateEntryFunc, Filter, LowerInitBlock (#11628)
This PR fixes a few inconsistent pass registration and add testcases for them. 
- `LowerInitBlock` had mismatch between its pass name and ffi key.
- `BindTarget`, `AnnotateEntryFunc`, `Filter` were not following the name convention of tir passes and they were not registered in FFI registry.
2022-06-09 10:14:46 -07:00
FranckQC d8678a6a9a [TIR] CSE pass : Restrict the equivalence to be decided by a normal form - avoids comparison of terms (#11574)
The CSE pass had been designed for potentially allowing comparisons (and commonings) of equivalent terms (like (x+y)+z and x+(y+z)), where **the notion of being equivalent was customizable, and no assumption was made about it**. That means that the implementation of the equivalence test function `EquivalentTerms()` - which was at the moment just calling the syntactical equality test `EqualTerms()` - could be replaced later by a cleverer equality test.

However, having such a generic way of comparing elements meant that in the function `SyntacticToSemanticComputations()`, where we were going from a hashtable of syntactical entities to what I called a vector of "semantical entites" (which are just canonical forms/representants of classes of equivalence of terms), **the only way was to compare each pair**.
That resulted in a quadratic behavior of this function, but there was no way around it as in order to merge equivalent entities into their class of equivalence, we had to compare them.

**This PR essentially does the following:**

- When computing the classes of equivalences of terms (therefore transforming a ComputationTable (i.e. a hashtable) into a vector of classes of equivalence) : **instead of comparing each pair of terms, relies on a normalization procedure to obtain a normal form for each of them**.
That transforms a small part of the algorithm that was quadratic to n.logn. However, it's difficult to see improvements in practice, in particular for average sized programs, as that part was a "small" quadratic to a "big" n.logn (finding things in a hash-table, copying it to a vector, etc).
It was probably going from a complexity of ~O(((n²-n)/2) + n.logn) to a complexity of ~O(3n + n.logn), so potential gains would only be expected for very large programs.

- Completely gives the user the possibility to turn ON/OFF the semantical comparisons of terms. It is turned OFF by default (as it's quite longer to compile with it ON, unsurprisingly), which means that by default, the equivalence coincides with the (syntactical) equality of terms.
    As the pass was written with the possibility to do these additional commonings (like (x+y)+z and x+(y+z)), it was a good time to fully plug that completely, up to the Python user who can now turn that ON if he wants to. But again, it is OFF by default, so no real change on that.

To run it ON, simply do:
`with tvm.transform.PassContext(config={'tir.enable_equiv_terms_in_cse_tir':True}):`
before calling `build()`

- When this boolean is set to ON, it uses a simple implementation of the normalization function with equivalences that uses `arith::Analyzer::Simplify` as noted by in https://github.com/apache/tvm/pull/10544 . Note that this is not a real normalization procedure as it is incomplete (i.e., it is not guarantee to converge to the normal form), but it is correct, and it works well with most properties : associativity of +, distributivity of * on +, etc.

- Clarifies and enhance the test base for the pass. In particular, it adds the tests that were written in https://github.com/apache/tvm/pull/10544 but which did not make it through.

- Also add the test ( https://github.com/AndrewZhaoLuo/TVM-Sandbox/blob/19284ddbd6bb28af61c0c2aa8bb334c5c53731a7/tir/test_inconsistent_tir_lowering.py#L1 ) demonstrating the (older) non-deterministic lowering and put it into a proper test, as I found it useful for making sure that this does not happen again. It has been copied from https://github.com/apache/tvm/pull/10663 and only slightly adapted (in particular for doing the comparison of hashes automatically instead of printing them and relying on a human to compare them).
2022-06-09 09:32:15 -07:00
Egor Churaev 2f9d9b4e5c [OpenCL] Implement conv2d_winograd algorithm for Adreno (#11543)
* Implement conv2d_winograd algorithm for Adreno

* Implement gtest for OpenCL texture pool

* Implement conv2d_nhwc_winograd for Adreno

* Minor refactoring

* Fix lint

* Apply comments

* Apply comments

* Fix lint
2022-06-09 13:31:55 +09:00
Sevin F. Varoglu df4f4c0b4b [ONNX] Add ReduceSum opset13 support (non-dynamic) (#11606)
* [ONNX] Add ReduceSum opset13 support (non-dynamic)

* Add check

* Add support for constant axis

* noop

* Rework logic
2022-06-08 14:08:06 -07:00
Mehrdad Hessar 97e681dc34 [Hexagon] Add random string to workspace name (#11593) 2022-06-08 13:23:58 -07:00
billishyahao 9817338508 [BYOC][DNNL] Enable layer normalization in DNNL byoc. (#11508)
* Enable layer normalization in DNNL byoc.

* Added unittest for layer norm and make code compatible after introducing TensorRequisite(PR-11345)

* Fix lint issue

* Fix clang format issue
2022-06-09 04:12:36 +09:00
Xiyou Zhou 96a513cd97 Patch replay trace. (#11621) 2022-06-08 11:39:42 -07:00
Philipp van Kempen e19cf20054 TVMC: Allow to overwrite TVM_CONFIGS_JSON_DIR via environment variables (#11623)
If a non-default location for the build directory is used, e.g. set via TVM_LIBRARY_PATH
we need to provide the user a way to overwrite CONFIGS_JSON_DIR as well.
2022-06-08 14:21:29 +01:00
Kathryn (Jinqi) Chen 52d90da1d3 [MetaSchedule] TuningRecord Optional Arguments (#11598)
In some situations, such as before measuring the candidates, the arguments `run_secs`, `target`, and `args_info` in `TuningRecord` are not required. Per this request, the new `TuningRecord` API now accepts arguments in the order of `trace, workload, run_secs, target, args_info` with the last three being optional. Note that some tests might fail due to the change of argument order, so they might need to be adjusted accordingly.
2022-06-07 18:05:14 -07:00
Eric Lunderberg d490620085 [Hexagon][CI] Re-enable Hexagon tests in CI (#11613)
* [Hexagon][CI] Re-enable Hexagon tests in CI

These were enabled in https://github.com/apache/tvm/pull/11294, then
erroneously disabled in https://github.com/apache/tvm/pull/11313.
This applies the same fix as in
https://github.com/apache/tvm/pull/11294, checking the
`ANDROID_SERIAL_NUMBER` to determine if Hexagon tests can execute at
runtime, but using the refactored `pytest.skipif` messages introduced
in https://github.com/apache/tvm/pull/11313.

* Fixed circular dependency, but feels somewhat ugly
2022-06-07 17:16:37 -05:00
Xiyou Zhou 12440895e4 [MetaSchedule] Add Testing Script with ONNX Support (#11587)
This PR introduces 2 tuning script for meta schedule and auto scheduler tuning support with onnx files. Now we can easily introduce onnx models benchmarking with command line scripts. Sample tuning call looks similar to the following script

For Meta Schedule ONNX tuning:
```
python3 -m tvm.meta_schedule.testing.tune_onnx_meta_schedule \
    --model-name   "$MODEL_NAME"                             \
    --onnx-path    "$ONNX_PATH"                              \
    --input-shape  "$INPUT_SHAPE"                            \
    --target       "$TARGET"                                 \
    --num-trials   $NUM_TRIALS                               \
    --rpc-host     $RPC_HOST                                 \
    --rpc-port     $RPC_PORT                                 \
    --rpc-key      $RPC_KEY                                  \
    --rpc-workers  $RPC_WORKERS                              \
    --work-dir     $WORK_DIR                                 \
    |& tee         "$WORK_DIR/$MODEL_NAME.log"
```

For AutoScheduler ONNX tuning:
```
python3 -m tvm.meta_schedule.testing.tune_onnx_auto_scheduler \
    --model-name   "$MODEL_NAME"                              \
    --onnx-path    "$ONNX_PATH"                               \
    --input-shape  "$INPUT_SHAPE"                             \
    --target       "$TARGET"                                  \
    --num-trials   $NUM_TRIALS                                \
    --rpc-host     $RPC_HOST                                  \
    --rpc-port     $RPC_PORT                                  \
    --rpc-key      $RPC_KEY                                   \
    --rpc-workers  $RPC_WORKERS                               \
    --log-dir      $WORK_DIR                                  \
    |& tee         "$WORK_DIR/$MODEL_NAME.log"
```
2022-06-07 11:08:32 -07:00
Altan Haan 32a86f8304 [TOPI] TE implementation of LSTM using scan (#11531)
* TE implementation of LSTM in TOPI

* docstring

* lint

* add injective tags where applicable
2022-06-07 10:33:21 -07:00
Junru Shao 68dcecc926 [MetaSchedule] Evo Independence from TaskScheduler (#11590)
Per discussion with @Kathryn-cat, we realized that the current API
design could be verbose if we only want to tune a single task, in which
case a dummy task scheduler still needs to be established to supply
`EvolutionarySearch` with proper `CostModel` and `Database`. This PR
fixes this UX issue.
2022-06-06 20:02:18 -07:00
Tristan Konolige 9d6599c928 [PROFILER] Add configuration information to profiler (#11530)
Configuration is a place to store extra information related to the
specific profiler run. Right now it is just the executor used and the
number of threads. The roofline analysis also adds peak flops and peak
bandwidth.
2022-06-06 08:49:22 -07:00
Luke Hutton 1aac4d6826 [microNPU] Optimize separate padding operation for conv2d (#11468)
Optimizes a case where padding appears as a separate nn.pad operation followed by a qnn.conv2d. If possible, the nn.pad will be partitioned and offloaded together with the qnn.conv2d operation, as opposed to separately. As a fallback, both operations will be considered separately.

cc Mousius NicolaLancellotti ekalda manupa-arm
2022-06-06 14:10:22 +00:00
Luke Hutton 609d6af176 [microNPU] Fix output mismatch in Leaky ReLU (#11397)
* [microNPU] Fix output mismatch in Leaky ReLU

All codegen tests have been running with a representative dataset
between 0,1 which masked an output mismatch in Leaky ReLU when compared
to TFLite kernels. This issue can be replicated by replacing the
representative dataset range with something like -1,1.

To fix this mismatch, we use the same implementation for calculating
LUT values as Vela which uses arithmetic constrained to quantized
values, rather than the previously used floating point calculations.

Change-Id: I0ed52215acd27722873be609271971b6fc4aaef1

* fix lint

Change-Id: Ica7de0c000ee015e79fe10985b2ec7a9b341861f

* fix lint again

Change-Id: I005d90ad248bfff7090f99d161eefbdc962cba48
2022-06-06 13:29:07 +01:00
Kathryn (Jinqi) Chen 8a568bc823 [MetaSchedule] exposed method: TuneContextNodeInitialize (#11576)
I exposed the initialize() method for TuneContextNode on the C++ side and added a corresponding method to TuneContext class on the Python side, so that we do not need to call initialize_with_tune_context for every scheduling rule.
2022-06-05 19:44:52 -07:00
Junru Shao 9d2c9a7f64 [TIR] Schedule Primitive: Add-Unit-Loop (#11575)
In TE, a unit loop could be introduced by fusing an empty list of loops on a stage. This PR adds its counterpart in TIR, while being a bit more explicit with a new schedule primitive which adds a unit loop without impacting any existing functionalities.
2022-06-04 17:48:19 -07:00
Krzysztof Parzyszek 8823757f30 [TIR] Expose tir.call_cpacked in python (#11563) 2022-06-03 16:09:24 -05:00
Eric Lunderberg b885362c36 [CI] Refactor of tvm.testing.requires_* annotations (#11313)
* [CI] Improved skip messages when using @tvm.testing.requires_*

Previously, the same message was given regardless of why a test
couldn't be run.  This has been split up into separate checks for TVM
cmake options in `config.cmake`, enabled targets in `TVM_TEST_TARGETS`
environment variable, and checks for available hardware.

* Refactor to specify repeated feature marks, compile-only markers

* Fixed lint errors

* Import from contrib, not from a different import

* Removed use of requires_llvm() as a list of marks

* Corrected mark from requires_gpu to requires_cuda

* Adding missing "not"

* Added USE_CMSISNN as a requirement for corstone300.
2022-06-03 14:03:08 -07:00
Krzysztof Parzyszek 4811d702f3 [Hexagon] Register strategy for concatenate (#11562)
* [Hexagon] Register strategy for concatenate

* Restart CI
2022-06-03 15:23:32 -05:00
Mark Shields 9dceb4e191 [BYOC] Two helper passes for external codegen using RelayToTIR custom pass machinery (#11474)
* [BYOC] Two helper passes for external codegen using RelayToTIR custom pass machinery

(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).

For reasons explained in the above thread I'm moving CUTLASS to be IRModule-at-a-time external codegen
using a custom RelayToTIR pass instead of the traditional function-at-a-time external codegen using
a relay.ext.cutlass registered function. This means some of the rewriing done on-the-fly by LowerTEPass now
needs to be done by the custom pass directly. This PR supplies two passes which ease that burden:
 - Before starting the CUTLASS-specific processing, make sure all "Compiler" attributed functions have
   unique global definitions (ie are outlined). Though functions start in this form after BYOC partitioning,
   under Graph and AOT compilation flows those functions are then inlined to pass through the 'codegen' keyhole
   which assumes the whole model is just one self-contained main function. This pass will undo that. (I gave up
   trying to just remove the inlining in the first place.)
 - After the CUTLASS-specific processing the now compiled "Compiler" attributed functions need to marked as
   'extern'. The te_compiler.cc uses the "ExternalSymbol" attribute for that, but since a) the symbol name
   is never needed, on the presense of the attribute is significant downstream and b) "ExternalSymbol" is
   easy to confuse with "global_symbol", I just replaced "ExternalSymbol" with "Extern" with an Integer(1)
   (cf "Primitive").

 The outlining pass is a little more general than necessary because it (will also) be used by Collage to
 rewrite the IRModule into optimally partitioned form while making maximal reuse of partition functions.
 Hence the abstract GlobalSymbolCache.

* - Andrew's comments
2022-06-03 13:19:53 -07:00
Tristan Konolige f31477f9c3 [FIX] Pad feature vectors to the same size in xgboost cost model (#11479)
* [FIX] Pad feature vectors to the same size in xgboost cost model

* add test

* more test

* explaination

* formatting
2022-06-02 16:47:20 -07:00
Tristan Konolige aff1312e36 [PROFILER] Fix percent compute bound calculation (#11542)
* [PROFILER] Fix percent compute bound calculation

Somehow the runtime was dropped from the percent compute bound
calculation. Tolerances on the test we bumped a little bit higher to try
and catch mistakes like this in the future.

* forgot print
2022-06-02 14:37:11 -07:00
Wuwei Lin 12a0f3edcf [TIR] Add schedule primitive ReIndex (#11515) 2022-06-02 14:34:23 -07:00
Jocelyn S 480fa744eb [Onnx] Round operator (#11446)
* banker round op added based off tutorial

* black'd onnx.py file

* retriggering CI with empty commit due to autoscheduler test failure

* removed youtube link in comments

* retriggering CI due to test failure that passed locally
2022-06-02 10:15:04 -07:00
ChunPing Chung 4f5ab57d34 [Frontend][ONNX] Fix softmax converter when input shape is dynamic (#11507)
* [Frontend][ONNX] Fix softmax converter when input shape is dynamic

* [Frontend][ONNX] mark dynamic softmax tests as xfailed with cuda
2022-06-02 09:28:38 -07:00
mhyang-pllab e60849c899 Add ceil shape registration (#11533) 2022-06-02 16:53:15 +09:00
Sergey e84f163f57 [TE] Optimized version of concatenation layer (#11341)
* [TE] Optimized version of concatenation layer
     1. Concat implemented using extern_op
     2. New tests added.
     3. Workaround to allow inline extern_op-s with other layers.

* *test fix

* test_any.py fix.

* test_forward.py from tensorflow fix.

* lint fix.

* Fixes after code review.

* New comment added.

* Lint fix.

* Another lint fix.

* Comments added.

* rebase issue fix.

* Restored previous state.

* Update after code review.

* After code review changes.

* lint review.

* Change strategy for cuda to fix tests.

* Rebase to main

* Comments changes after review.

* Some more comments fixes.

* One more error fix in comments.

* restart build
2022-06-02 05:13:41 +09:00
Nicola Lancellotti ee26ecf1d5 [microNPU] Add transform matrices and part matcher to identity op (#11453)
* [microNPU] Add transform matrices and part matcher to identity op

* Address comments

* Enable cascader in identity tests

* Address comments
2022-06-01 15:51:56 +01:00
Junru Shao a71536a130 [MetaSchedule] Enable Task Filtering (#11512)
This PR allows `relay.backend.MetaScheduleExtractTask` to take an extra argument `filter_func` which filters out tasks that don't need tuning. The counterpart of AutoScheduler is `traverse_to_get_io_tensors`.
2022-05-31 15:57:30 -07:00
Mehrdad Hessar 2252f958f7 [microTVM][ARM][Zephyr] Add CMSIS dependencies in Zephyr project build (#11362)
* Test with CMSIS build added

disabled conv2d_nhwc_dsp.arm_cpu for non integers workloads

added debugging feature to TempDirectory

* revert arm_cpu strategy changes

* Address Andrew comments

* change copy to include

* add cmsis_path only as project option
2022-05-31 13:27:01 -07:00
wrongtest c1b22eefb5 [Arith] Merge surjective/non-surjective iter mapping detections (#11287)
* simplify (x * 96) % 64 to (x * 32) % 64

* adapt merge mulmod opt for OffsetOf computation

* merge DetectIterMap and DetectIterMapPadded

* adjust related interfaces for IterMapLevel

* - check incompatible left paddings
- determine case like x % 16, x in [0, 5) to be non-surjective, since usages may treat the region extent as 16 by mistake.
- skip second round of rewrite when there is no padding
- fix some typo in comments

* rebase upstream
2022-05-31 11:50:00 -07:00
Steven S. Lyubomirsky bc14f26aca [Frontend][PyTorch][Bugfix] Ignore Cuda in PyTorch version number when comparing versions (#11511)
* Do not consider cuda in the PT version number

* Add docstring
2022-05-31 08:53:00 +09:00