pytorch / executorch

On-device AI across mobile, embedded and edge for PyTorch
https://pytorch.org/executorch/
Other
1.39k stars 228 forks source link

can not run install_flatc.sh sucecessfully #1004

Closed luxunxiansheng closed 7 months ago

luxunxiansheng commented 8 months ago

When following the instructions given by the tutorial, Cmake error occured:

executorch/third-party/flatbuffers" does not appear to contain CMakeLists.txt.

I missed something?

kimishpatel commented 8 months ago

Did you do git submodule sync/update? If you inspect third-party/flatbuffers folders and it is empty then likely submodule has not been fetched.

luxunxiansheng commented 8 months ago

Did you do git submodule sync/update? If you inspect third-party/flatbuffers folders and it is empty then likely submodule has not been fetched.

I did run that commads but as you said the folder is empty. Is there any workarond before the bug fixed?

kimishpatel commented 8 months ago

When I have run into this in past, I have done manual fetch or update of the submodule

try git submodule init and then sync. more details https://git-scm.com/book/en/v2/Git-Tools-Submodules

Also add your repro steps here

cccclai commented 8 months ago

Usually these following commands can get me the submodules

git submodule update --init
git submodule update
git submodule sync

Are all the folders in executorch/third-party empty?

luxunxiansheng commented 8 months ago

git submodule sync

I follow the steps given in tutorai. sync/ update --init . Now a fatal occured :

fatal: unable to access 'https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none fatal: clone of 'https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git' into submodule path 'backends/arm/third-party/ethos-u-core-driver' failed

Is it for this ?

luxunxiansheng commented 8 months ago

Usually these following commands can get me the submodules

git submodule update --init
git submodule update
git submodule sync

Are all the folders in executorch/third-party empty? all the folders in 'executorch/third-party' are empty.

cccclai commented 8 months ago

Hmm that's for the arm backend. Seperately, are there contents inside executorch/third-party/flatbuffers now?

luxunxiansheng commented 8 months ago

Hmm that's for the arm backend. Seperately, are there contents inside executorch/third-party/flatbuffers now?

No contents as before.

kimishpatel commented 8 months ago

try git submodule init and then sync. more details https://git-scm.com/book/en/v2/Git-Tools-Submodules

@luxunxiansheng did you try following these steps?

luxunxiansheng commented 8 months ago

Yes, I tried different combinations of commands. No helps.

kimishpatel commented 8 months ago

Something seems off in your setup. Have you tried starting from scratch again?

I tried following tutorial in a fresh dir and it seems to clone flatbuffers correctly for me.

Can you paste log of what happened (just terminal capture) when you follow the steps of clone + submodule update?

luxunxiansheng commented 8 months ago

image

luxunxiansheng commented 7 months ago

Something seems off in your setup. Have you tried starting from scratch again?

I tried following tutorial in a fresh dir and it seems to clone flatbuffers correctly for me.

Can you paste log of what happened (just terminal capture) when you follow the steps of clone + submodule update?

Is the screen shot helpful ?

kimishpatel commented 7 months ago

Something seems off in your setup. Have you tried starting from scratch again? I tried following tutorial in a fresh dir and it seems to clone flatbuffers correctly for me. Can you paste log of what happened (just terminal capture) when you follow the steps of clone + submodule update?

Is the screen shot helpful ?

Did you try

git submodule sync
git submodule update --init

What is the output you saw for that?

luxunxiansheng commented 7 months ago

Something seems off in your setup. Have you tried starting from scratch again? I tried following tutorial in a fresh dir and it seems to clone flatbuffers correctly for me. Can you paste log of what happened (just terminal capture) when you follow the steps of clone + submodule update?

Is the screen shot helpful ?

Did you try

git submodule sync
git submodule update --init

What is the output you saw for that?

image

robell commented 7 months ago

It looks like the submodule call fails as it tries to clone ethos-u first and other modules don't clone after that.

I can see no issues with the certificate and can fetch and browse to that repository. @luxunxiansheng can you browse (web browser) to https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/ ? perhaps there is a certificate issue with the LetsEncrypt root cert on your machine?

What version of git are you using? (git --version)

kimishpatel commented 7 months ago

Thanks @robell . Sounds like thats the issue. @digantdesai @robell ideally we bring in these dep as part of "install requirements" of specific delegates.

luxunxiansheng commented 7 months ago

It looks like the submodule call fails as it tries to clone ethos-u first and other modules don't clone after that.

I can see no issues with the certificate and can fetch and browse to that repository. @luxunxiansheng can you browse (web browser) to https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/ ? perhaps there is a certificate issue with the LetsEncrypt root cert on your machine?

What version of git are you using? (git --version) My server doesn't have desktop that I can't visit the link via browser. But I can visit it from other machine.
My git version is 2.39.2

robell commented 7 months ago

@kimishpatel that would be a longer term fix, in the short term it appears to be a certificate issue on the end system @luxunxiansheng has. An easy workaround would be to remove the sub-module locally if as it seems no one else has this issue.

@luxunxiansheng:

  1. can you access (with a web browser) https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/ ?
  2. The certificates look correct and other people are able to clone this repo, what happens if you: git clone --progress --verbose https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/
  3. what about output forwget -vd https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/
luxunxiansheng commented 7 months ago
  1. image
  2. I can get the index.html
luxunxiansheng commented 7 months ago

@kimishpatel that would be a longer term fix, in the short term it appears to be a certificate issue on the end system @luxunxiansheng has. An easy workaround would be to remove the sub-module locally if as it seems no one else has this issue.

@luxunxiansheng:

  1. can you access (with a web browser) https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/ ?
  2. The certificates look correct and other people are able to clone this repo, what happens if you: git clone --progress --verbose https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/
  3. what about output forwget -vd https://git.mlplatform.org/ml/ethos-u/ethos-u-core-driver.git/

My server doesn't have desktop that I can't visit the link via browser. But I can visit it from other machine. BTW.

robell commented 7 months ago

can you try the wget command? this might help show whether the certificates file has a problem on the server.

luxunxiansheng commented 7 months ago

can you try the wget command? this might help show whether the certificates file has a problem on the server.

image

robell commented 7 months ago

Ok, so we can see the ssl cert is valid and this machine can read via https in wget; it seems a problem then with git's use of ssl certificates in /etc/ssl/certs/.

A workaround would be to try git config --global http.sslVerify "false" (but be aware this disables all verification of certificates!)

An alternative workaround would be to remove the ethos-u submodule as this isn't relevant for you: https://www.educative.io/answers/how-to-delete-a-git-submodule (though you of course cannot push this change back). if you just want to get it working, i'd suggest trying this second option.

luxunxiansheng commented 7 months ago

Ok, so we can see the ssl cert is valid and this machine can read via https in wget; it seems a problem then with git's use of ssl certificates in /etc/ssl/certs/.

A workaround would be to try git config --global http.sslVerify "false" (but be aware this disables all verification of certificates!)

An alternative workaround would be to remove the ethos-u submodule as this isn't relevant for you: https://www.educative.io/answers/how-to-delete-a-git-submodule (though you of course cannot push this change back). if you just want to get it working, i'd suggest trying this second option.

Sorry to bother you agagin and again . But it did not work when I tried the second option. I think I have remove the submodule. image When I run that install scripit, still the same errors that flatbuffers is empyt.

robell commented 7 months ago

This is a clean checkout flow: git clone --branch v0.1.0 https://github.com/pytorch/executorch.git cd executorch git submodule deinit backends/arm/third-party/ethos-u-core-driver/ git submodule deinit backends/arm/third-party/serialization_lib/ git rm backends/arm/third-party/ethos-u-core-driver/ git rm backends/arm/third-party/serialization_lib/ rm -rf .git/modules/backends/arm/third-party/ethos-u-core-driver/ rm -rf .git/modules/backends/arm/third-party/serialization_lib/ git submodule update --init git submodule update git submodule sync

If this sequence does not populate third-party/flatbuffers/ then there is some other issue.

I suspect with a clean checkout even git config --global http.sslVerify "false" would work.

luxunxiansheng commented 7 months ago

Thanks guys for your patience. Now it works even got some errors during installing. image Anyway, Thank you so much!

robell commented 7 months ago

great, you can also remove these from install to fix that error:

diff --git a/setup.py b/setup.py index ddcdc158..4d3334ad 100644 --- a/setup.py +++ b/setup.py @@ -60,8 +60,6 @@ setup( "executorch/sdk": "sdk", "executorch/extension": "extension", "executorch/bundled_program": "bundled_program", - "tosa": "backends/arm/third-party/serialization_lib/python/tosa", - "serializer": "backends/arm/third-party/serialization_lib/python/serializer", }, cmdclass={ "install": CustomInstallCommand,

kimishpatel commented 7 months ago

@robell is there a way to move backend/arm/ isntallation requirements to a separate install_requirements.sh, similar to https://github.com/pytorch/executorch/blob/main/backends/apple/coreml/scripts/install_requirements.sh