-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Topi] Cortex-M DSP support #9233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
177 commits
Select commit
Hold shift + click to select a range
ee5c4bf
Added scripts to run simple model
6800b8d
moved common functions to separate file
30169d0
added convinient funcs for working with models
a34ddcb
fixed AOT & project template to grovety folder
5560645
added conv2d test: using of tensorflow and merging of results
3fe5aa8
Added new interface to the MCU firmware (AOT)
ae4d9e3
added mnist model skeleton
5049d86
Fixed opening model for sine_zephyr
0e24218
Addedd mnist model
407b8ff
Added full support for mnist model
f853977
model conversion hack added
ae4c851
Arm7m C code optimization integrated. Removed %4 requirement for chan…
0493721
Merge remote-tracking branch 'mir/PRJ1445-1-conv2d' into grovety
a892bca
added support for quantized model
d1a33e0
Update gemm intrinsic (python\tvm\topi\arm_cpu\cortex_m7\micro_kernel…
GermanTretiakov ecf7bb2
Fix for qnn.conv2d legalized to int16
0ceb612
Switch between gemm8 and gemm16.
GermanTretiakov 5f257ca
Merge remote-tracking branch 'mir/Auto_gemm8_gemm16' into PRJ1445-3-a…
4e8f56e
Format fixes, restores asserts for SMLAD usage
34b1b6f
Added CIFAR10 model
a81bf16
Great refactoring. All the modeles structured to run in the same way
32364a7
Try to remove arm_math.h and arm_nnsupportfunctions.h files from C code.
GermanTretiakov 820969c
Fix: double {{ and }}
GermanTretiakov e6ac0d7
Add max_pool intrinsic (only C code).
GermanTretiakov dce7874
Merge remote-tracking branch 'mir/Auto_gemm8_gemm16' into grovety
4327ce2
Add relu intrinsic (only C code).
GermanTretiakov 176d2c4
added { } to follow codestyle
c19d943
Added intrinsics enabling depending on the target
1860689
removed useless int8-int16 conversion
0f01b71
added disable optimization flag
6dc7e11
Merge remote-tracking branch 'mir/Auto_gemm8_gemm16' into grovety
c1c9f97
Fix: gemm16 update (mistyped with body).
GermanTretiakov 4f8ab09
Added dataset for cifar10
25156b0
Merge remote-tracking branch 'mir/gemm_fixed' into grovety
0f68a39
Added data conversion to CIFAR10
a73df72
Small refactoring.
GermanTretiakov f4a4d82
Small fix: gemm_reset
GermanTretiakov aeef970
Merge remote-tracking branch 'mir/gemm_fixed' into grovety
47a0711
[PRJ1445-PR1-candidate] First upload.
02ff764
[PRJ1445-PR1-candidate] Fixed gemm.py. Again.
1ebe1d8
Updated test for different targets, Added missing deps
9196909
[PRJ1445-PR1-candidate] Fix test model.
690dd17
Removed check for in_channels % 4 for conv2d_direct_simd
aea91dd
Added ARM v7m test case to microTVM reference-VM base_box_test.sh
5f8f587
Schedule for max_pool2d for arm_cpu
b4b01d4
max_pool intrinsic (not tested at all).
GermanTretiakov fcbe0a3
Merge remote-tracking branch 'mir/PR1445-PR1-candidate' into grovety
3212f44
added --skip-flash flag to grovety script
e7da13e
Merge remote-tracking branch 'mir/grovety' into PRJ1445-3-arm-schedules
5351360
Types and checks for max_pool intrin, added pragma
83e254d
Moved intrinsics for max to micro_kernel dir
1b03c68
Fix: typo
GermanTretiakov c97fcf3
Try to measure operations cost.
GermanTretiakov facd7df
small refactoring of max_pool stuff
49976a2
Add calls of timer in gemm .
GermanTretiakov f1ebae9
layout conversion is made by default now
2abea65
Added grovety performance timer
f044427
Dense schedule for arm_cpu
500ef88
Add dense default strategy for arm_cpu
4617429
Fix: put extern "C" under #ifdef
GermanTretiakov b094dbf
fixed tiny typos
795c1e2
added perf timer
e911e5c
Merge remote-tracking branch 'mir/fix_gemm_timer' into grovety
8a05a55
Merge remote-tracking branch 'mir/dense-schedule' into grovety
86f4906
Added per-op benchmarking
be1aa86
Finally added a proper parsing of the march parameter of 'target' string
414b431
Update: max_pool can work with unaligned pointers (not tested at all).
GermanTretiakov ed695fd
avg_pool draft
fc5556a
fixes for intrinsic and tensorization pattern
4023481
fixes after rebase, removed SMUAD from isa
3dd6cb8
Added a hack to enable -O3 optimization
2f99b9e
Merge branch 'optimization' into grovety
a26c811
Merge remote-tracking branch 'mir/unaligned_max_pool' into grovety
dad1cbd
Merge remote-tracking branch 'mir/avg-pool-2d' into grovety
5fcec5e
Add MaxPool1d schedule
2ef763f
Merge remote-tracking branch 'mir/MaxPool1d' into grovety
a1794c3
Try to remove CMSIS headers from gemm functions.
GermanTretiakov 750f0e3
Move system declarations into cortex_m7_defines.h to prevent duplicat…
GermanTretiakov 1fb5e14
Add: __asm, stdint.h
GermanTretiakov b28719e
Add schedule for depthwise_conv2d_nhwc
e442e11
cortex defines moved
9e186ab
Add __SSUB8, __SEL .
GermanTretiakov 38c05e9
Merge remote-tracking branch 'mir/8717-x86-DwsConv2d-schedule' into g…
d69b725
removed all references to CMSIS
5531f6b
Merge remote-tracking branch 'mir/no_cmsis_headers' into grovety
4181a73
Add annotation for schedule_depthwise_conv2d_nhwc
327179f
Add AvgPool1d schedule
caa3f66
Merge remote-tracking branch 'mir/8717-x86-DwsConv2d-schedule' into g…
c12fb05
Merge remote-tracking branch 'mir/avg-pool-1d' into grovety
b024a1a
added cifar10_2 data
6908a95
relay reading update
7b50e1d
Fixed data preparation to send to network
5755f17
all the models moved to specific folder
2e71d7a
Added custom include for M7 (no CMSIS)
e333d0e
Added networks for avg/max pool 1d
daf4743
new version of the Andrew's demo model
4d73775
template for running model on the CPU (for result comparing)
dd0c0df
Merge branch 'cifar10_from_relay' into grovety
0854f40
first version (not working)
080a7a9
fix conv1d
748d1a6
fix axis order for conv1d
c198db9
Added support of M33
74d693f
Added avg_pool 2D test
f4f410f
Conv1d implementation similar to conv2d with autotvm
1640f0f
Check for unsupported layout
68cfdb3
Merge remote-tracking branch 'mir/conv1d' into grovety
66bcec9
Check for WOI kernel layout
c2698c8
Fixed conv naming issue during import
5d1e0d2
Added additional types for input/output
4cfcad0
more synth models for tests
8307915
Merge remote-tracking branch 'mir/conv1d' into grovety
7620afc
use x86 depthwise_conv2d_nhwc schedule for arm_cpu
f29b131
Check and show warning for unsupported types for pooling
647e3ff
Renaming for maxpool micro-kernel
64efb87
Add x86 schedule for depthwise_conv2d_nhwc
a7adf41
use x86 depthwise_conv2d_nhwc schedule for arm_cpu
37d3c81
added assert for unaligned pointers in the gemm16
a6c4e07
Expanding stack to 4k
5963b4b
Merge branch 'branch' into grovety
7a6217c
Merge remote-tracking branch 'mir/pool-type-check' into grovety
eafab3e
Merge remote-tracking branch 'mir/issue8717' into grovety
0482186
Merge remote-tracking branch 'mir/8717-x86-DwsConv2d-schedule' into g…
32ede71
fix test_export_model_library_format_workspace
4398d5f
Fix for max_pool8 micro-kernel renaming
fd657b9
Added complex test
8f036c3
Merge remote-tracking branch 'mir/fix-max-pool-kernel-naming' into gr…
2811f99
Added SIMD disabling flag to complex test
0b1c836
Merge remote-tracking branch 'mir/issue8717' into grovety
c18164a
move schedule_depthwise_conv2d_nhwc to generic conv2d, add test for s…
950c5ea
fix format
ab6f111
Revert "fix test_export_model_library_format_workspace"
a52e09e
fix format in test_topi_depthwise_conv2d.py
1190245
Merge remote-tracking branch 'mir/issue8717' into grovety
f015b88
Merge remote-tracking branch 'origin/main' into grovety
5aaba80
initial simd test commit
3e80c0c
Do not run corstone integration tests for GPU-only mode
73569f2
Added @tvm.testing.requires_corstone300 decorator
38f6c5a
Added corstone300 marker processing
66a4587
Added target opts to aot_test... compiation process
3c4e2e2
Removed unused code from M7 micro_kernel generation
766db57
Added target_opts parameter instead of separate param for every option
71d8ff6
Added common defines for m7 simd
b7dc932
Added missing types for aot input data codegen
977559b
Tests added
6986fe1
removed "strange" code
cab48e7
tests fixed
7acbb63
Merge remote-tracking branch 'mir/corstone-tests' into cortex-m7-intr…
a52a48a
avg_pool micro kernel bugfix
771ae0d
tests fixed
feacab6
Fix for intrin_sum accumulator reset for avgpool_1d
9270261
Removed unused target options
6a0c573
Added --corstone300 parameter to enable simd tests
7006824
Added more m7 test cases, fixed cmsisnn includes
0f4e1ea
Added ASL header to fix lint check
cba97aa
renamed --corstone300 to --enable-corstone300-tests
a99440b
Fixed lint warnings
c082335
Added missing chech for None
94c8f3a
This file appeared here by mistake. relu SIMD implementation is not r…
3e54254
add a layout name for conv1d functions
cc42c4d
add cases for test_conv2d
66dbd5d
bugfix for the issue https://github.com/apache/tvm/issues/9226
638846a
fixed conv2d naming
4de1c16
minor changes according Andrew's comments
3c81bea
minor changes according Andrew's comments
388b62a
fix conv2d names
53c847c
return code instead of assert in gemm.py
3d577ca
change check for avg_pool
9c403fe
Merge branch 'PR2-preview' into cortex-m7-intrinsic
fb17329
Renaming of "Cortex-M7 SIMD" in commens to DSP
ilyag-grovety 4803e19
Merge branch 'main' into cortex-m7-intrinsic
ilyag-grovety 975aff4
Merge remote-tracking branch 'origin/main' into cortex-m7-intrinsic
6cec82c
Disable corstone tests for i386 run
a593538
Merge remote-tracking branch 'origin/main' into cortex-m7-intrinsic
bc2b4ec
methods renamed direct_simd -> dsp
be7078a
Fixed linter warnings
9d25cf6
Fixed test name
1407614
Merge commit '74accec52e41418d796b6699991c9136993b129e' into cortex-m…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # pylint: disable=invalid-name, unused-variable, no-else-return, unused-argument, import-outside-toplevel | ||
| """Conv1D schedule for ARM CPU""" | ||
| from __future__ import absolute_import as _abs | ||
|
|
||
| from tvm import autotvm | ||
|
|
||
| from .mprofile.dsp.conv1d import ( | ||
| conv1d_nwc_dsp_compute, | ||
| conv1d_nwc_dsp_schedule, | ||
| ) | ||
|
|
||
|
|
||
| @autotvm.register_topi_compute("conv1d_nwc_dsp.arm_cpu") | ||
| def conv1d_nwc_dsp(cfg, data, kernel, strides, padding, dilation, out_dtype): | ||
| """Compute conv1d with v7e-m DSP instructions.""" | ||
| return conv1d_nwc_dsp_compute(cfg, data, kernel, strides, padding, dilation, out_dtype) | ||
|
|
||
|
|
||
| @autotvm.register_topi_schedule("conv1d_nwc_dsp.arm_cpu") | ||
| def schedule_conv1d_nwc_dsp(cfg, outs): | ||
| return conv1d_nwc_dsp_schedule(cfg, outs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it also needs a skipif() in here. mark is on-by-default iiuc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm adding a pytest.marker.skip() to the tests marked requires_corstone300 in the tests/python/conftest.py depending on the value of the "--enable-corstone300-tests" flag. Haven't found a better way to control tests behavior since we don't have device_enabled() for corstone300
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a better way of controlling this - possibly something @Mousius could comment on here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i discussed this with @grant-arm a bit and it seems the consensus was that there isn't a good way to auto-detect the FVP. perhaps we've missed something though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on how these tests are ran, we could use the slightly icky AOT skip logic:
tvm/tests/python/relay/aot/aot_test_utils.py
Lines 196 to 201 in f4dae23
This would at least automate it if these tests are designed to run in CPU containers. Otherwise, we should just be able to check for the path since we know exactly where we're checking it out in the container:
tvm/docker/install/ubuntu_install_ethosu_driver_stack.sh
Line 23 in f4dae23