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

Fix Arm(R) Ethos(TM)-U55 NPU Demo app #9323

Merged
merged 6 commits into from
Oct 26, 2021
Merged

Conversation

grant-arm
Copy link
Contributor

Change tvmc arguments to -executor=aot -interface-api=c -unpacked-api=1 for Arm(R) Cortex(R)-M55 CPU and Arm(R) Ethos(TM)-U55 NPU Demo App.

#9218 changes the command line arguments required by tvmc which breaks the existing Arm(R) Cortex(R)-M55 CPU and Arm(R) Ethos(TM)-U55 NPU Demo App. This PR fixes the demo app.

@manupak
Copy link
Contributor

manupak commented Oct 19, 2021

I think we should enable running this in the CI -- to keep the demo up to date.

Copy link
Member

@Mousius Mousius left a comment

Choose a reason for hiding this comment

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

Sorry I missed this @grant-arm - let's get this fixed!

Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

I think we should add CI script changes to make sure its not broken again.

@Mousius
Copy link
Member

Mousius commented Oct 21, 2021

@manupa-arm it'd be better to land this fix which is effecting users (#8922 (comment)) and do any infrastructure work to automate this elsewhere.

@manupak
Copy link
Contributor

manupak commented Oct 21, 2021

Yes, however this PR passing CI does not give much assurance whether the demo is working or not.
What assurance would the user will have this is not broken again ?

Am I missing something or can't we atleast add something such as (if we want to explore other ways automating this later) :

# Test MISRA-C runtime
cd apps/bundle_deploy
rm -rf build
make test_dynamic test_static
cd ../..

@grant-arm
Copy link
Contributor Author

grant-arm commented Oct 21, 2021

I'll take a look at adding something to CI as part of this PR.

@Mousius
Copy link
Member

Mousius commented Oct 21, 2021

@manupa-arm, to answer your points:

Yes, however this PR passing CI does not give much assurance whether the demo is working or not.

I'm sure that @grant-arm would've tested this before raising a PR.

What assurance would the user will have this is not broken again ?

That's what the follow up work would be, taking the time to triage it and put a solution in place.

My concern is for other users who are attempting to use this demo who may not be part of the TVM community and thus aren't accounted for, if we're happy to accept that they'll come to TVM and find it broken then we can wait until the automation question is resolved.

@manupak
Copy link
Contributor

manupak commented Oct 21, 2021

Hi @Mousius ,

My concern is for other users who are attempting to use this demo who may not be part of the TVM community and thus aren't accounted for, if we're happy to accept that they'll come to TVM and find it broken then we can wait until the automation question is resolved.

Merging this will not guarantee that there wont be such users. In same way this issue occurred, we could have the same problem tomorrow without us knowing. Its better to raise an issue and point to this PR to increase awareness, if thats what we are after.

Moreover, can you shed some light why the automation question is bigger piece of work that needs to be in a follow up ?
Maybe that might give right motivation that Im lacking here.

- Change tvmc arguments to -executor=aot -interface-api=c -unpacked-api=1

Change-Id: Ic8d97ce9b4b11dc4d23ab028ac6a7832bca3ebbb
- Add a CI test for the Arm(R) Ethos(TM)-U55 NPU Demo app

Change-Id: I8c535e6be573ae2cb2223dcbb10c7a9e4180799d
@grant-arm
Copy link
Contributor Author

I've added a CI test now that runs the Arm(R) Cortex(R)-M55 CPU and Ethos(TM)-U55 NPU demo app.

- pip install tvm/python so that tvmc works from command line

Change-Id: Ieb6ec71dd3950f7d4657793f0d02a8078667b9d9
apps/microtvm/ethosu/run_demo.sh Show resolved Hide resolved
tests/scripts/task_cpp_unittest.sh Outdated Show resolved Hide resolved
tests/scripts/task_cpp_unittest.sh Outdated Show resolved Hide resolved

# Test Arm(R) Cortex(R)-M55 CPU and Ethos(TM)-U55 NPU demo app
if test -f "/opt/arm/FVP_Corstone_SSE-300_Ethos-U55/models/Linux64_GCC-6.4/FVP_Corstone_SSE-300_Ethos-U55" && pip3 list | grep vela; then
sudo pip3 install -e python
Copy link
Member

Choose a reason for hiding this comment

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

Should this not be done earlier rather than as a side effect of invoking the unit test script?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Mousius Could you please clarify where you think we should do this?

Copy link
Member

Choose a reason for hiding this comment

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

Unsure where exactly this would go but I'd guess somewhere like task_ci_setup.sh ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is fine for the current solution.
If we set a flag in future for use in multiple scripts/locations then we can think about setting it earlier.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not suggesting we shouldn't do it but this scripts responsibility is to run unit tests, this installs TVM python and all its dependencies as a side effect which I wouldn't expect from such a script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah right, I misunderstood. I see what you're saying now.
@manupa-arm Any ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Mousius As an alternative, we could use python3 -m tvm.driver.tvmc instead of tvmc ... in run_demo.sh but I was reluctant to do that because I thought run_demo.sh should serve as an example to users in how to use tvmc from the command line.

Copy link
Contributor

Choose a reason for hiding this comment

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

Im fine with either, we can put a comment in the script to say that (one could use tvmc directly once Pip installed) or we can move it to bit higher position in terms of scripts.

Since this tested now, if we need more time to figure out where to put the installation, happy to take python3 -m tvm.driver.tvmc (with a comment explaining how it could be used alternatively)

tests/scripts/task_cpp_unittest.sh Outdated Show resolved Hide resolved
- Changes task_cpp_unittest.sh addressing comments

Change-Id: I10decdcdcec3b61e27bacfac7e94e1449a22b1b7
- Avoid installing TVM python and all its dependencies

Change-Id: Iaa4dd5429871f02961cac12476f9dc46091bcb34
- Change the way we test for Vela being installed

Change-Id: Ieacb8ca9b4dd2af6821e579094ce86359c2da7f0
@manupak
Copy link
Contributor

manupak commented Oct 26, 2021

I think this is good enough for the fix (lets get this in) and thanks @grant-arm for quickly enabling it in the CI. I hope we can follow up with further changes.

Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

LGTM

@manupak manupak merged commit 75a8fa1 into apache:main Oct 26, 2021
@manupak
Copy link
Contributor

manupak commented Oct 26, 2021

Thanks @grant-arm @Mousius . Please do follow up with further concerns.

ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
* Change tvmc arguments to -executor=aot -interface-api=c -unpacked-api=1.
* Enable the demo running on the CI.
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* Change tvmc arguments to -executor=aot -interface-api=c -unpacked-api=1.
* Enable the demo running on the CI.
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.

3 participants