Commit Graph

3674 Commits

Author SHA1 Message Date
Jason f942d19788 [TVMC] Fix error while compile paddle model with tvmc (#11730)
The tvmc command will throw a error while the passed path of model is not exist, But for PaddlePaddle model, it contains 2 file model_name.pdmodel and model_name.pdiparams, we only pass the prefix like inference_model/model_name.

This pr is same with https://github.com/apache/tvm/pull/11108 
Since the origin PR didn't update for a long time, I send this new PR
2022-06-15 10:02:04 -07:00
Ashutosh Parkhi 3cb4597ed4 [CMSIS-NN] Fixed error in finding input's dtype in maxpool (#11701) 2022-06-15 16:47:26 +01:00
Junru Shao 1312658093 [MetaSchedule] Apply-History-Best Task Filtering (#11692)
This PR enables task filtering in Apply-History-Best, which is used in
Relay/Relax integration. Previously, even though a task is ruled out
during task extraction, it still shows up in Relay compilation due to
the lack of filtering on `Apply-History-Best`. However, TE-to-TIR
conversion `te.CreatePrimFunc` doesn't support all cases with hybrid
operators involved, which leads to post-tuning failure affecting
multiple models.
2022-06-15 13:10:24 +08:00
Jinkun Lin d2e2f71b14 Fix 1d-softmax schedule. (#11719) 2022-06-15 09:31:54 +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
Siva 27b0aad5a5 [BYOC-OpenCLML] OpenCLML integration with TVM. (#10243)
* [BYOC-OpenCLML] OpenCLML integration with TVM.

* [BYOC-OpenCLML] Cleanup and review.
2022-06-14 19:30:28 +09:00
AndrewZhaoLuo b659332a4c [AutoTVM][Autoscheduler] Default build funcs inherit PassContext (#11632)
* init commit

* lint

* empty commit

* test results

* reset progress

* lint

* fix
2022-06-13 15:20:09 -07:00
Jinkun Lin 85a190af7d Fix onnx round import with float64 inputs. (#11685)
* Fix onnx round import with float64 inputs.

* Fix lint and optimize dtype mapping.
2022-06-13 09:31:38 -07:00
Chris Sullivan 1420df7744 [TE] Support schedulable TIR compute definitions in TOPI (#11589)
This PR adds `te.extern_primfunc` which provides the interface around TE ExternOp that allows a TVMScript defined schedulable TIR PrimFunc to be inlined into a TE compute graph. The result is that TIR can be used for compute definitions in Relay OpStrategies and, paired with meta-scheduler support in relay as introduced in #10578, these compute definitions can be scheduled and tuned as demonstrated in the attached tests.  

Prior to this, compute definitions were limited to those definable in TE only. As a consequence of this patch and ongoing improvements to TVMScript meta-programming (#11097), TOPI can be extended to include compute and scheduling functions targeting schedulable TIR uniformly.
2022-06-13 08:50:19 -07:00
Xiyou Zhou e61ad7ab82 [MetaSchedule] Add Profiler Support For Tuning Efficiency Optimization (#11486)
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
2022-06-13 08:41:53 -07:00
Junru Shao 0df69611b2 [MetaSchedule] JSONDatabase Utilities (#11680)
This PR adds some utility to JSONDatabase to accelerate its loading/saving time.
2022-06-11 00:18:10 -07:00
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