Skip to content
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

[BYOC][ETHOSN] Introduce the Ethos-N BYOC integration #6222

Merged
merged 37 commits into from
Aug 19, 2020

Conversation

mbaret
Copy link
Contributor

@mbaret mbaret commented Aug 6, 2020

This is the first of 3 PRs to introduce the Ethos-N integration into TVM via the BYOC framework. It adds support for partitioning and compiling for the Ethos-N77 target with CPU fallback for unsupported operators. Additionally, runtime support is added in the form of an Ethos-N runtime module. In this initial PR, only quantized concatenate and split are supported with follow-up PRs adding support for many further operators.

Co-authored-by: Leo Blonk Leo.Blonk@arm.com @Leo-arm
Co-authored-by: Tristan O'Connor tristan.oconnor@arm.com @tristan-arm
Co-authored-by: Leandro Nunes leandro.nunes@arm.com @leandron
Co-authored-by: Ramana Radhakrishnan ramana.radhakrishnan@arm.com @u99127
Co-authored-by: Luke Hutton luke.hutton@arm.com @lhutton1

@mbaret
Copy link
Contributor Author

mbaret commented Aug 6, 2020

cc @zhiics @comaniac @masahi

Note that we're still awaiting the CI docker image to be updated and until then don't expect CI to pass.

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only reviewed the cmake and annotation parts due to bandwidth. Will spend time on the codegen and hopefully the runtime tomorrow.

cmake/config.cmake Outdated Show resolved Hide resolved
python/tvm/relay/op/contrib/ethosn.py Show resolved Hide resolved
src/relay/backend/contrib/ethosn/capabilities.h Outdated Show resolved Hide resolved
Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work!
One high-level suggestion to this PR is to let reviewers know if somewhere is going to be improved in follow-up PRs by TODOs; otherwise some places look overfilled.

src/relay/backend/contrib/ethosn/codegen_ethosn.h Outdated Show resolved Hide resolved
src/relay/backend/contrib/ethosn/codegen_ethosn.h Outdated Show resolved Hide resolved
return sl::TensorInfo();
}

void InferTensorsVisitor::InferCall(const CallNode* cn) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we inline this function to InferTensorsVisitor::VisitExpr_(const CallNode* cn)? I didn't see any other reference to this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivation behind this is principally clarity rather than necessity. The InferCall function ends up getting very long as more operators are introduced and we wanted to separate this lengthy function from the traversal logic so that it is quick to reason about the traversal without having to scan through a huge block of code. If you don't think this clarity if worthwhile, then we can inline it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense to me in the case of more ops will be added to this function in the future, although the flow Call -> HandleCall looks a bit weird. Let's keep the current implementation for both functions for now and see if there is a better way after most ops are added.

return ops;
}

sl::TensorsAndId ConstructNetworkVisitor::HandleCall(const CallNode* cn) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. Can we inline this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

tests/python/contrib/test_ethosn/infrastructure.py Outdated Show resolved Hide resolved
tests/python/contrib/test_ethosn/infrastructure.py Outdated Show resolved Hide resolved
tests/python/contrib/test_ethosn/infrastructure.py Outdated Show resolved Hide resolved
tests/python/contrib/test_ethosn/infrastructure.py Outdated Show resolved Hide resolved
tests/scripts/task_config_build_cpu.sh Outdated Show resolved Hide resolved
@mbaret
Copy link
Contributor Author

mbaret commented Aug 10, 2020

In addition to the suggested changes, I've added some further comments/documentation and moved implementations out of header files.

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of my comments have been addressed. Thanks for the efforts :)
Also cc @zhiics @masahi for their reviews.

Copy link
Member

@zhiics zhiics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Some high-level comments:

  • It looks that this is a different from C source module and the json runtime module. Could you elaborate a bit why those two don't fit?
  • It seems that we are not really able to test them on HW in the CI. Is there any plan on this?
  • Why do we start from concat instead of conv2d?

cmake/modules/contrib/EthosN.cmake Outdated Show resolved Hide resolved
cmake/util/FindEthosN.cmake Outdated Show resolved Hide resolved


@tvm.ir.register_op_attr("split", "target.ethos-n")
def split(attrs, args):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate a bit why we currently chose these two ops other than more common ones like conv2d, etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conv2D is coming in the next PR. We split it up like this so that we could focus initially on the mechanics of the integration itself. Split/Concat motivate the tuple handling in the codegen which is why they were introduced now. Conv2D has a lot of other complexity to do with conversion between TVM and Support Library and so we thought that would be best handled separately.

namespace contrib {
namespace ethosn {

/* Ethos-N variants (N77, N57 and N37)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, what would need to change later for the support of N78? Is this backward compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same architecture/software stack, so we anticipate it is just an extension of what is already here.

src/runtime/contrib/ethosn/ethosn_device.cc Outdated Show resolved Hide resolved
src/runtime/contrib/ethosn/ethosn_runtime.h Outdated Show resolved Hide resolved
tests/python/contrib/test_ethosn/infrastructure.py Outdated Show resolved Hide resolved
src/runtime/contrib/ethosn/ethosn_runtime.h Outdated Show resolved Hide resolved
src/relay/backend/contrib/ethosn/ethosn_api.cc Outdated Show resolved Hide resolved
@mbaret
Copy link
Contributor Author

mbaret commented Aug 11, 2020

It looks that this is a different from C source module and the json runtime module. Could you elaborate a bit why those two don't fit?

The Ethos-N compiler compiles the graph down to a so-called 'command stream' which is a binary artifact that is directly consumed by the driver to execute the inference. It has encoded within it all the constants/weights. We're not calling out to a C library so the C source module wouldn't make sense here. Additionally, the JSON runtime wouldn't really add any useful functionality. We just want to load the artifact off the disk and wrap it in a packed function.

It seems that we are not really able to test them on HW in the CI. Is there any plan on this?

We don't expect there to be HW in CI. CI will run SW testing including a mocked inference function so that we can test the compilation flow all the way through to the runtime. We will be running automated HW testing on a range of networks within Arm.

To be explicit about the next 2 PRs, they are already written and only add more operators. Specifically, the next PR will add quantized conv2d and the final one will add quite a few more less complex operators. We wanted to split these up to make it easier to see how the codegen operates without the added complexity of all the other operators. The final PR will also include network tests for mobilenet, inceptionv3/4 and ssd mobilenet.

mbaret and others added 21 commits August 13, 2020 09:50
This is the first of 3 PRs to introduce the Ethos-N
integration into TVM via the BYOC framework. It adds
support for partitioning and compiling for the
Ethos-N77 target with CPU fallback for unsupported
operators. Additionally, runtime support is added in
the form of an Ethos-N runtime module. In this initial
PR, only quantized concatenate and split are supported
with follow-up PRs adding support for many further operators.


Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>
Change-Id: Ie2ce4528e16e93aa83df46f8a229c0ce89b45252
Change-Id: Iebd0c62d6bc7e446662abdee4882ac874ad98aa3
Change-Id: I0c89e380dd1d795755a1884c06a7b317a99fe297
Change-Id: I2e96a1c818a82e5174fd94e483b0bdb3e4375a7d
Change-Id: Id5c9cfb866914a0298b44ead40fcbe3764ce443c
Change-Id: I78e54fb9f472d2815886bea4d94b7247e0d129de
Change-Id: Iecfea7dca7301dd684199c9b32f99f2113fdfd56
Change-Id: Idf5cab853027adb0b0292de877e6dc02683821d7
Change-Id: If4643924768c2d7ea98525e9f792b7223cc2bcdf
Change-Id: Ia689c59cac28bd91e237ceecd829d8cf56d0d9c1
Change-Id: I149b97b28b516c7d9288a0858b2fbf1497e70250
Change-Id: I2db5b89d8fe2c114ab92305cdcf06d0fc45f4d2a
Change-Id: Idd955755d6f6d1cd3843462f627d0d952729e467
Change-Id: I0ea866adf5d9166db85dd82d013a631d991ae633
Change-Id: I869e8233d41c6ab7c2dc80f47d976c974043b80c
Change-Id: I79a6ffcfd48cd055d279f493c672ec82f0c68e5c
Change-Id: I1e88c07a47464e44cb45c6a327ec9c7e2d70cc94
Change-Id: I4fc1b462a74f8fae231ebafac614dd8d45be0feb
Change-Id: I5586a7ba7ce71da667a6a9c6dd2e591028eb43b2
Change-Id: I80e1d494c6d574be06a2375e831343485712914d
Change-Id: I4b64a87f32b3616ec87c9937d9fc998b8dc5d7b4
Change-Id: I16988f3adbe6e03fc47fa0a77cb5febb7a02eaab
Change-Id: I664982d219f9a7d1f961dbfe84d12f66e2e5f5cb
Change-Id: Id965ccc037fd40cbdfcb58d922cc8d5fb8c87dfe
Change-Id: I7f8c3f5c8948c3f15551d28e3fee6e00120663ef
Change-Id: Ifb861ebbfeaaf4b154f4b1515f83a46aecf86e50
Change-Id: I920568cc7a81cd77d44f8604f571340a330f3e62
Change-Id: Ib605458127485e2015ac012ec515ced5900705f3
Change-Id: I32f3c967192c7c278ef33c52cac5fb5da682cd1b
@mbaret
Copy link
Contributor Author

mbaret commented Aug 17, 2020

Now the docker image is updated this passes CI, could you take another look @zhiics @masahi ?

const ObjectPtr<Object>& sptr_to_self) {
if (network_map_.find(name) != network_map_.end()) {
return PackedFunc([sptr_to_self, this, name](TVMArgs args, TVMRetValue* rv) {
*rv = Inference(args, network_map_[name].cmm.get(), network_map_[name].inputs,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very minor issue, but isn't it looking up network_map_ on every inference call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, to get the correct function from the module according to the name.

/*!
* \brief A base class for error handling using ErrorReporter.
*/
class ErrorReportingPass {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you probably don't have to have this error reporter. Jared has built a more powerful diagnostic error reporter in #6162. And we will need to migrate all error reporting in Relay to it. cc @jroesch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error reporter is primarily to assist us in debugging. Do you know of any existing passes that have been migrated?

Copy link
Member

@zhiics zhiics Aug 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, you can probably keep this for now and work on it later when #6274 is merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool :)

@zhiics
Copy link
Member

zhiics commented Aug 17, 2020

Mostly LGTM. @Leo-arm, @tristan-arm, @leandron, @u99127, @lhutton1, can any of you take a look as well since you are more familiar with the ARM side?

@leandron
Copy link
Contributor

Mostly LGTM. @Leo-arm, @tristan-arm, @leandron, @u99127, @lhutton1, can any of you take a look as well since you are more familiar with the ARM side?

Thanks @zhiics - we conducted an internal code review before submitting this PR, so it is fair to assume most people mentioned here already approved this patch.

@Leo-arm
Copy link
Contributor

Leo-arm commented Aug 17, 2020

We have done internal reviews for our initial integration, this patch and the next few, and this LGTM.

@mbaret
Copy link
Contributor Author

mbaret commented Aug 19, 2020

ping @zhiics

@zhiics
Copy link
Member

zhiics commented Aug 19, 2020

@masahi had a comment above, can you respond?

@zhiics zhiics merged commit 3cff742 into apache:master Aug 19, 2020
@zhiics
Copy link
Member

zhiics commented Aug 19, 2020

Thanks @mbaret @masahi @comaniac @leandron @Leo-arm

@mbaret
Copy link
Contributor Author

mbaret commented Aug 19, 2020

Thanks everyone :)

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [BYOC][ETHOSN] Introduce the Ethos-N BYOC integration

This is the first of 3 PRs to introduce the Ethos-N
integration into TVM via the BYOC framework. It adds
support for partitioning and compiling for the
Ethos-N77 target with CPU fallback for unsupported
operators. Additionally, runtime support is added in
the form of an Ethos-N runtime module. In this initial
PR, only quantized concatenate and split are supported
with follow-up PRs adding support for many further operators.


Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>

* Turn off USE_ETHOSN_HW by default

Change-Id: Ie2ce4528e16e93aa83df46f8a229c0ce89b45252

* Update capabilities file

Change-Id: Iebd0c62d6bc7e446662abdee4882ac874ad98aa3

* Fix missing header

Change-Id: I0c89e380dd1d795755a1884c06a7b317a99fe297

* Update cmake comments on ETHOSN_HW

Change-Id: I2e96a1c818a82e5174fd94e483b0bdb3e4375a7d

* Add checker for case when USE_ETHOSN=OFF and USE_ETHOSN_HW=ON

Change-Id: Id5c9cfb866914a0298b44ead40fcbe3764ce443c

* Fix 'available' boolean

Change-Id: I78e54fb9f472d2815886bea4d94b7247e0d129de

* Check availability in op registration

Change-Id: Iecfea7dca7301dd684199c9b32f99f2113fdfd56

* Remove unnecessary line

Change-Id: Idf5cab853027adb0b0292de877e6dc02683821d7

* Simplify getting output_size

Change-Id: If4643924768c2d7ea98525e9f792b7223cc2bcdf

* Remove unnecessary new line

Change-Id: Ia689c59cac28bd91e237ceecd829d8cf56d0d9c1

* Remove NOLINTS

Change-Id: I149b97b28b516c7d9288a0858b2fbf1497e70250

* Remove unused parts of PR

Change-Id: I2db5b89d8fe2c114ab92305cdcf06d0fc45f4d2a

* Fix CI Ethos-N settings

Change-Id: Idd955755d6f6d1cd3843462f627d0d952729e467

* Removed unnecessary line in infra

Change-Id: I0ea866adf5d9166db85dd82d013a631d991ae633

* Remove unnecessary len in infra

Change-Id: I869e8233d41c6ab7c2dc80f47d976c974043b80c

* Rename 'cpu_ops' to 'host_ops'

Change-Id: I79a6ffcfd48cd055d279f493c672ec82f0c68e5c

* Added explanation on mocking

Change-Id: I1e88c07a47464e44cb45c6a327ec9c7e2d70cc94

* IsEthosOp -> IsEthosnOp

Change-Id: I4fc1b462a74f8fae231ebafac614dd8d45be0feb

* Improve documentation in ethosn_api.h

Change-Id: I5586a7ba7ce71da667a6a9c6dd2e591028eb43b2

* No longer iterate over module when compiling

Change-Id: I80e1d494c6d574be06a2375e831343485712914d

* Move EthosnCompiler implementations into codegen.cc

Change-Id: I5bb6e9f62722d930d9dc040ac62bf87f29dd74c5

* Fix linting

Change-Id: Ia44ec741a5330ad289cc6b5cd2bb1ed784fe6afc

* Refactor EthosnAPI compilation functions into EthosnCompiler

Change-Id: Iee0aecbe43a84fefb437ab9ff064e3f8b42c80a4

* Improve docs for Tvm2Npu

Change-Id: Ia39e9e1508513ca39c1d585fbccc3ae38fcbb9fb

* Move more implementation out of headers

Change-Id: I1e33084ceb520b75f06b4d7a4acff5b9b2225bd5

* Move implementation in ethosn_api.h

Change-Id: I51ab386892a2aa84aa47d03641aac8468f5737ae

* Improve docs for capabilities.h

Change-Id: Iaaee508aafa1cbb7650a04ed87bd6c1b91823a58

* Use else() in cmake

Change-Id: I4b64a87f32b3616ec87c9937d9fc998b8dc5d7b4

* Use GetDataSize

Change-Id: I16988f3adbe6e03fc47fa0a77cb5febb7a02eaab

* Use const&

Change-Id: I664982d219f9a7d1f961dbfe84d12f66e2e5f5cb

* Fix python linting

Change-Id: Id965ccc037fd40cbdfcb58d922cc8d5fb8c87dfe

* Remove load/save to file

Change-Id: I7f8c3f5c8948c3f15551d28e3fee6e00120663ef

* data->data

Change-Id: Ifb861ebbfeaaf4b154f4b1515f83a46aecf86e50

* Remove specific cpu target

Change-Id: I920568cc7a81cd77d44f8604f571340a330f3e62

* Test export/load module

Change-Id: Ib605458127485e2015ac012ec515ced5900705f3

* Fix cmake garbage

Change-Id: I32f3c967192c7c278ef33c52cac5fb5da682cd1b

Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [BYOC][ETHOSN] Introduce the Ethos-N BYOC integration

This is the first of 3 PRs to introduce the Ethos-N
integration into TVM via the BYOC framework. It adds
support for partitioning and compiling for the
Ethos-N77 target with CPU fallback for unsupported
operators. Additionally, runtime support is added in
the form of an Ethos-N runtime module. In this initial
PR, only quantized concatenate and split are supported
with follow-up PRs adding support for many further operators.


Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>

* Turn off USE_ETHOSN_HW by default

Change-Id: Ie2ce4528e16e93aa83df46f8a229c0ce89b45252

* Update capabilities file

Change-Id: Iebd0c62d6bc7e446662abdee4882ac874ad98aa3

* Fix missing header

Change-Id: I0c89e380dd1d795755a1884c06a7b317a99fe297

* Update cmake comments on ETHOSN_HW

Change-Id: I2e96a1c818a82e5174fd94e483b0bdb3e4375a7d

* Add checker for case when USE_ETHOSN=OFF and USE_ETHOSN_HW=ON

Change-Id: Id5c9cfb866914a0298b44ead40fcbe3764ce443c

* Fix 'available' boolean

Change-Id: I78e54fb9f472d2815886bea4d94b7247e0d129de

* Check availability in op registration

Change-Id: Iecfea7dca7301dd684199c9b32f99f2113fdfd56

* Remove unnecessary line

Change-Id: Idf5cab853027adb0b0292de877e6dc02683821d7

* Simplify getting output_size

Change-Id: If4643924768c2d7ea98525e9f792b7223cc2bcdf

* Remove unnecessary new line

Change-Id: Ia689c59cac28bd91e237ceecd829d8cf56d0d9c1

* Remove NOLINTS

Change-Id: I149b97b28b516c7d9288a0858b2fbf1497e70250

* Remove unused parts of PR

Change-Id: I2db5b89d8fe2c114ab92305cdcf06d0fc45f4d2a

* Fix CI Ethos-N settings

Change-Id: Idd955755d6f6d1cd3843462f627d0d952729e467

* Removed unnecessary line in infra

Change-Id: I0ea866adf5d9166db85dd82d013a631d991ae633

* Remove unnecessary len in infra

Change-Id: I869e8233d41c6ab7c2dc80f47d976c974043b80c

* Rename 'cpu_ops' to 'host_ops'

Change-Id: I79a6ffcfd48cd055d279f493c672ec82f0c68e5c

* Added explanation on mocking

Change-Id: I1e88c07a47464e44cb45c6a327ec9c7e2d70cc94

* IsEthosOp -> IsEthosnOp

Change-Id: I4fc1b462a74f8fae231ebafac614dd8d45be0feb

* Improve documentation in ethosn_api.h

Change-Id: I5586a7ba7ce71da667a6a9c6dd2e591028eb43b2

* No longer iterate over module when compiling

Change-Id: I80e1d494c6d574be06a2375e831343485712914d

* Move EthosnCompiler implementations into codegen.cc

Change-Id: I5bb6e9f62722d930d9dc040ac62bf87f29dd74c5

* Fix linting

Change-Id: Ia44ec741a5330ad289cc6b5cd2bb1ed784fe6afc

* Refactor EthosnAPI compilation functions into EthosnCompiler

Change-Id: Iee0aecbe43a84fefb437ab9ff064e3f8b42c80a4

* Improve docs for Tvm2Npu

Change-Id: Ia39e9e1508513ca39c1d585fbccc3ae38fcbb9fb

* Move more implementation out of headers

Change-Id: I1e33084ceb520b75f06b4d7a4acff5b9b2225bd5

* Move implementation in ethosn_api.h

Change-Id: I51ab386892a2aa84aa47d03641aac8468f5737ae

* Improve docs for capabilities.h

Change-Id: Iaaee508aafa1cbb7650a04ed87bd6c1b91823a58

* Use else() in cmake

Change-Id: I4b64a87f32b3616ec87c9937d9fc998b8dc5d7b4

* Use GetDataSize

Change-Id: I16988f3adbe6e03fc47fa0a77cb5febb7a02eaab

* Use const&

Change-Id: I664982d219f9a7d1f961dbfe84d12f66e2e5f5cb

* Fix python linting

Change-Id: Id965ccc037fd40cbdfcb58d922cc8d5fb8c87dfe

* Remove load/save to file

Change-Id: I7f8c3f5c8948c3f15551d28e3fee6e00120663ef

* data->data

Change-Id: Ifb861ebbfeaaf4b154f4b1515f83a46aecf86e50

* Remove specific cpu target

Change-Id: I920568cc7a81cd77d44f8604f571340a330f3e62

* Test export/load module

Change-Id: Ib605458127485e2015ac012ec515ced5900705f3

* Fix cmake garbage

Change-Id: I32f3c967192c7c278ef33c52cac5fb5da682cd1b

Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [BYOC][ETHOSN] Introduce the Ethos-N BYOC integration

This is the first of 3 PRs to introduce the Ethos-N
integration into TVM via the BYOC framework. It adds
support for partitioning and compiling for the
Ethos-N77 target with CPU fallback for unsupported
operators. Additionally, runtime support is added in
the form of an Ethos-N runtime module. In this initial
PR, only quantized concatenate and split are supported
with follow-up PRs adding support for many further operators.


Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>

* Turn off USE_ETHOSN_HW by default

Change-Id: Ie2ce4528e16e93aa83df46f8a229c0ce89b45252

* Update capabilities file

Change-Id: Iebd0c62d6bc7e446662abdee4882ac874ad98aa3

* Fix missing header

Change-Id: I0c89e380dd1d795755a1884c06a7b317a99fe297

* Update cmake comments on ETHOSN_HW

Change-Id: I2e96a1c818a82e5174fd94e483b0bdb3e4375a7d

* Add checker for case when USE_ETHOSN=OFF and USE_ETHOSN_HW=ON

Change-Id: Id5c9cfb866914a0298b44ead40fcbe3764ce443c

* Fix 'available' boolean

Change-Id: I78e54fb9f472d2815886bea4d94b7247e0d129de

* Check availability in op registration

Change-Id: Iecfea7dca7301dd684199c9b32f99f2113fdfd56

* Remove unnecessary line

Change-Id: Idf5cab853027adb0b0292de877e6dc02683821d7

* Simplify getting output_size

Change-Id: If4643924768c2d7ea98525e9f792b7223cc2bcdf

* Remove unnecessary new line

Change-Id: Ia689c59cac28bd91e237ceecd829d8cf56d0d9c1

* Remove NOLINTS

Change-Id: I149b97b28b516c7d9288a0858b2fbf1497e70250

* Remove unused parts of PR

Change-Id: I2db5b89d8fe2c114ab92305cdcf06d0fc45f4d2a

* Fix CI Ethos-N settings

Change-Id: Idd955755d6f6d1cd3843462f627d0d952729e467

* Removed unnecessary line in infra

Change-Id: I0ea866adf5d9166db85dd82d013a631d991ae633

* Remove unnecessary len in infra

Change-Id: I869e8233d41c6ab7c2dc80f47d976c974043b80c

* Rename 'cpu_ops' to 'host_ops'

Change-Id: I79a6ffcfd48cd055d279f493c672ec82f0c68e5c

* Added explanation on mocking

Change-Id: I1e88c07a47464e44cb45c6a327ec9c7e2d70cc94

* IsEthosOp -> IsEthosnOp

Change-Id: I4fc1b462a74f8fae231ebafac614dd8d45be0feb

* Improve documentation in ethosn_api.h

Change-Id: I5586a7ba7ce71da667a6a9c6dd2e591028eb43b2

* No longer iterate over module when compiling

Change-Id: I80e1d494c6d574be06a2375e831343485712914d

* Move EthosnCompiler implementations into codegen.cc

Change-Id: I5bb6e9f62722d930d9dc040ac62bf87f29dd74c5

* Fix linting

Change-Id: Ia44ec741a5330ad289cc6b5cd2bb1ed784fe6afc

* Refactor EthosnAPI compilation functions into EthosnCompiler

Change-Id: Iee0aecbe43a84fefb437ab9ff064e3f8b42c80a4

* Improve docs for Tvm2Npu

Change-Id: Ia39e9e1508513ca39c1d585fbccc3ae38fcbb9fb

* Move more implementation out of headers

Change-Id: I1e33084ceb520b75f06b4d7a4acff5b9b2225bd5

* Move implementation in ethosn_api.h

Change-Id: I51ab386892a2aa84aa47d03641aac8468f5737ae

* Improve docs for capabilities.h

Change-Id: Iaaee508aafa1cbb7650a04ed87bd6c1b91823a58

* Use else() in cmake

Change-Id: I4b64a87f32b3616ec87c9937d9fc998b8dc5d7b4

* Use GetDataSize

Change-Id: I16988f3adbe6e03fc47fa0a77cb5febb7a02eaab

* Use const&

Change-Id: I664982d219f9a7d1f961dbfe84d12f66e2e5f5cb

* Fix python linting

Change-Id: Id965ccc037fd40cbdfcb58d922cc8d5fb8c87dfe

* Remove load/save to file

Change-Id: I7f8c3f5c8948c3f15551d28e3fee6e00120663ef

* data->data

Change-Id: Ifb861ebbfeaaf4b154f4b1515f83a46aecf86e50

* Remove specific cpu target

Change-Id: I920568cc7a81cd77d44f8604f571340a330f3e62

* Test export/load module

Change-Id: Ib605458127485e2015ac012ec515ced5900705f3

* Fix cmake garbage

Change-Id: I32f3c967192c7c278ef33c52cac5fb5da682cd1b

Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
* [BYOC][ETHOSN] Introduce the Ethos-N BYOC integration

This is the first of 3 PRs to introduce the Ethos-N
integration into TVM via the BYOC framework. It adds
support for partitioning and compiling for the
Ethos-N77 target with CPU fallback for unsupported
operators. Additionally, runtime support is added in
the form of an Ethos-N runtime module. In this initial
PR, only quantized concatenate and split are supported
with follow-up PRs adding support for many further operators.


Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>

* Turn off USE_ETHOSN_HW by default

Change-Id: Ie2ce4528e16e93aa83df46f8a229c0ce89b45252

* Update capabilities file

Change-Id: Iebd0c62d6bc7e446662abdee4882ac874ad98aa3

* Fix missing header

Change-Id: I0c89e380dd1d795755a1884c06a7b317a99fe297

* Update cmake comments on ETHOSN_HW

Change-Id: I2e96a1c818a82e5174fd94e483b0bdb3e4375a7d

* Add checker for case when USE_ETHOSN=OFF and USE_ETHOSN_HW=ON

Change-Id: Id5c9cfb866914a0298b44ead40fcbe3764ce443c

* Fix 'available' boolean

Change-Id: I78e54fb9f472d2815886bea4d94b7247e0d129de

* Check availability in op registration

Change-Id: Iecfea7dca7301dd684199c9b32f99f2113fdfd56

* Remove unnecessary line

Change-Id: Idf5cab853027adb0b0292de877e6dc02683821d7

* Simplify getting output_size

Change-Id: If4643924768c2d7ea98525e9f792b7223cc2bcdf

* Remove unnecessary new line

Change-Id: Ia689c59cac28bd91e237ceecd829d8cf56d0d9c1

* Remove NOLINTS

Change-Id: I149b97b28b516c7d9288a0858b2fbf1497e70250

* Remove unused parts of PR

Change-Id: I2db5b89d8fe2c114ab92305cdcf06d0fc45f4d2a

* Fix CI Ethos-N settings

Change-Id: Idd955755d6f6d1cd3843462f627d0d952729e467

* Removed unnecessary line in infra

Change-Id: I0ea866adf5d9166db85dd82d013a631d991ae633

* Remove unnecessary len in infra

Change-Id: I869e8233d41c6ab7c2dc80f47d976c974043b80c

* Rename 'cpu_ops' to 'host_ops'

Change-Id: I79a6ffcfd48cd055d279f493c672ec82f0c68e5c

* Added explanation on mocking

Change-Id: I1e88c07a47464e44cb45c6a327ec9c7e2d70cc94

* IsEthosOp -> IsEthosnOp

Change-Id: I4fc1b462a74f8fae231ebafac614dd8d45be0feb

* Improve documentation in ethosn_api.h

Change-Id: I5586a7ba7ce71da667a6a9c6dd2e591028eb43b2

* No longer iterate over module when compiling

Change-Id: I80e1d494c6d574be06a2375e831343485712914d

* Move EthosnCompiler implementations into codegen.cc

Change-Id: I5bb6e9f62722d930d9dc040ac62bf87f29dd74c5

* Fix linting

Change-Id: Ia44ec741a5330ad289cc6b5cd2bb1ed784fe6afc

* Refactor EthosnAPI compilation functions into EthosnCompiler

Change-Id: Iee0aecbe43a84fefb437ab9ff064e3f8b42c80a4

* Improve docs for Tvm2Npu

Change-Id: Ia39e9e1508513ca39c1d585fbccc3ae38fcbb9fb

* Move more implementation out of headers

Change-Id: I1e33084ceb520b75f06b4d7a4acff5b9b2225bd5

* Move implementation in ethosn_api.h

Change-Id: I51ab386892a2aa84aa47d03641aac8468f5737ae

* Improve docs for capabilities.h

Change-Id: Iaaee508aafa1cbb7650a04ed87bd6c1b91823a58

* Use else() in cmake

Change-Id: I4b64a87f32b3616ec87c9937d9fc998b8dc5d7b4

* Use GetDataSize

Change-Id: I16988f3adbe6e03fc47fa0a77cb5febb7a02eaab

* Use const&

Change-Id: I664982d219f9a7d1f961dbfe84d12f66e2e5f5cb

* Fix python linting

Change-Id: Id965ccc037fd40cbdfcb58d922cc8d5fb8c87dfe

* Remove load/save to file

Change-Id: I7f8c3f5c8948c3f15551d28e3fee6e00120663ef

* data->data

Change-Id: Ifb861ebbfeaaf4b154f4b1515f83a46aecf86e50

* Remove specific cpu target

Change-Id: I920568cc7a81cd77d44f8604f571340a330f3e62

* Test export/load module

Change-Id: Ib605458127485e2015ac012ec515ced5900705f3

* Fix cmake garbage

Change-Id: I32f3c967192c7c278ef33c52cac5fb5da682cd1b

Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
* [BYOC][ETHOSN] Introduce the Ethos-N BYOC integration

This is the first of 3 PRs to introduce the Ethos-N
integration into TVM via the BYOC framework. It adds
support for partitioning and compiling for the
Ethos-N77 target with CPU fallback for unsupported
operators. Additionally, runtime support is added in
the form of an Ethos-N runtime module. In this initial
PR, only quantized concatenate and split are supported
with follow-up PRs adding support for many further operators.


Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>

* Turn off USE_ETHOSN_HW by default

Change-Id: Ie2ce4528e16e93aa83df46f8a229c0ce89b45252

* Update capabilities file

Change-Id: Iebd0c62d6bc7e446662abdee4882ac874ad98aa3

* Fix missing header

Change-Id: I0c89e380dd1d795755a1884c06a7b317a99fe297

* Update cmake comments on ETHOSN_HW

Change-Id: I2e96a1c818a82e5174fd94e483b0bdb3e4375a7d

* Add checker for case when USE_ETHOSN=OFF and USE_ETHOSN_HW=ON

Change-Id: Id5c9cfb866914a0298b44ead40fcbe3764ce443c

* Fix 'available' boolean

Change-Id: I78e54fb9f472d2815886bea4d94b7247e0d129de

* Check availability in op registration

Change-Id: Iecfea7dca7301dd684199c9b32f99f2113fdfd56

* Remove unnecessary line

Change-Id: Idf5cab853027adb0b0292de877e6dc02683821d7

* Simplify getting output_size

Change-Id: If4643924768c2d7ea98525e9f792b7223cc2bcdf

* Remove unnecessary new line

Change-Id: Ia689c59cac28bd91e237ceecd829d8cf56d0d9c1

* Remove NOLINTS

Change-Id: I149b97b28b516c7d9288a0858b2fbf1497e70250

* Remove unused parts of PR

Change-Id: I2db5b89d8fe2c114ab92305cdcf06d0fc45f4d2a

* Fix CI Ethos-N settings

Change-Id: Idd955755d6f6d1cd3843462f627d0d952729e467

* Removed unnecessary line in infra

Change-Id: I0ea866adf5d9166db85dd82d013a631d991ae633

* Remove unnecessary len in infra

Change-Id: I869e8233d41c6ab7c2dc80f47d976c974043b80c

* Rename 'cpu_ops' to 'host_ops'

Change-Id: I79a6ffcfd48cd055d279f493c672ec82f0c68e5c

* Added explanation on mocking

Change-Id: I1e88c07a47464e44cb45c6a327ec9c7e2d70cc94

* IsEthosOp -> IsEthosnOp

Change-Id: I4fc1b462a74f8fae231ebafac614dd8d45be0feb

* Improve documentation in ethosn_api.h

Change-Id: I5586a7ba7ce71da667a6a9c6dd2e591028eb43b2

* No longer iterate over module when compiling

Change-Id: I80e1d494c6d574be06a2375e831343485712914d

* Move EthosnCompiler implementations into codegen.cc

Change-Id: I5bb6e9f62722d930d9dc040ac62bf87f29dd74c5

* Fix linting

Change-Id: Ia44ec741a5330ad289cc6b5cd2bb1ed784fe6afc

* Refactor EthosnAPI compilation functions into EthosnCompiler

Change-Id: Iee0aecbe43a84fefb437ab9ff064e3f8b42c80a4

* Improve docs for Tvm2Npu

Change-Id: Ia39e9e1508513ca39c1d585fbccc3ae38fcbb9fb

* Move more implementation out of headers

Change-Id: I1e33084ceb520b75f06b4d7a4acff5b9b2225bd5

* Move implementation in ethosn_api.h

Change-Id: I51ab386892a2aa84aa47d03641aac8468f5737ae

* Improve docs for capabilities.h

Change-Id: Iaaee508aafa1cbb7650a04ed87bd6c1b91823a58

* Use else() in cmake

Change-Id: I4b64a87f32b3616ec87c9937d9fc998b8dc5d7b4

* Use GetDataSize

Change-Id: I16988f3adbe6e03fc47fa0a77cb5febb7a02eaab

* Use const&

Change-Id: I664982d219f9a7d1f961dbfe84d12f66e2e5f5cb

* Fix python linting

Change-Id: Id965ccc037fd40cbdfcb58d922cc8d5fb8c87dfe

* Remove load/save to file

Change-Id: I7f8c3f5c8948c3f15551d28e3fee6e00120663ef

* data->data

Change-Id: Ifb861ebbfeaaf4b154f4b1515f83a46aecf86e50

* Remove specific cpu target

Change-Id: I920568cc7a81cd77d44f8604f571340a330f3e62

* Test export/load module

Change-Id: Ib605458127485e2015ac012ec515ced5900705f3

* Fix cmake garbage

Change-Id: I32f3c967192c7c278ef33c52cac5fb5da682cd1b

Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Co-authored-by: Luke Hutton <luke.hutton@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants