espressif / esp-nn

Optimised Neural Network functions for Espressif chipsets
Apache License 2.0
146 stars 24 forks source link

`esp-nn` 1.1.0 release on registry breaking older versions of `idf-component-manager` #17

Open kbx81 opened 2 months ago

kbx81 commented 2 months ago

Checklist

Issue or Suggestion Description

We are using esp-tflite-micro which has a dependency on esp-nn; it appears that the recent release to esp-nn and corresponding update in the registry is causing problems with older versions of idf-component-manager.

Specifically, idf_component.yml as pulled from the registry includes the repository_info key which is not recognized by the version of idf-component-manager we're using. It's noteworthy that this key is not present in the idf_component.yml which appears in the repository; it only appears in the content pulled from the Espressif component registry.

Please see our build logs here.

To confirm a workaround, I've forked esp-tflite-micro and tested two alternative dependency configurations:

  1. I simply removed the ^ from the version: line within dependencies, forcing it to use the 1.0.0-rc1 which we know works.
  2. I reconfigured the dependency to use the esp-nn GitHub repo directly (as opposed to the Espressif component registry) and explicitly specified version: "v1.1.0".

Both of these alternate configurations resolved the error from idf-component-manager, of course at the expense of now having to use a fork (which we would prefer not to do).

It appears that moving to platformio/espressif32 v6.6.0 with framework-espidf v5.2.1 or later gets us "compatible" idf-component-manager but we do not wish to make such a change at this time. Are there any other ways to fix this issue? Could we perhaps get a release of framework-espidf with IDF v5.1.4 including a newer/compatible version of idf-component-manager?

vikramdattu commented 2 months ago

Hi @kbx81 thanks for bringing this to light.

Are there any other ways to fix this issue? Could we perhaps get a release of framework-espidf with IDF v5.1.4 including a newer/compatible version of idf-component-manager?

Newer releases do update the component manager version. Meaning, this will get updated with v5.1.5.

Easy way is to fix the component manager is to install the latest component manager using following pip command, after ESP-IDF setup is done:

python -m pip install idf-component-manager

kbx81 commented 2 months ago

Thank you for the reply @vikramdattu -- sorry for my delay circling back.

We are using platformio -- in short, ESPHome builds a platformio project with relevant source files and then hands it off to platformio to handle the build.

I have been experimenting a bit with using platformio's extra_scripts variable to call a "pre:" script. This works, but when python -m pip install idf-component-manager runs, it's installing into the environment in use before the venv is created in which the build runs.

Take a look at the build logs here -- on line 132, we see the latest version of idf-component-manager is installed as expected by the "pre" script I added.

However, later, on line 189, the build venv is created and the older version of idf-component-manager installed on line 206. This older version is ultimately what gets used to attempt to retrieve esp-nn, which fails and derails the build.

Admittedly, platformio is a bit of a "black box" to me, so perhaps there is a way to fix this that I haven't learned about yet. A look through platformio configuration doesn't seem to reveal a way to hook into that part of the build. Do you have any suggestions as to how I might resolve this?

kbx81 commented 2 months ago

Are there any other ways to fix this issue? Could we perhaps get a release of framework-espidf with IDF v5.1.4 including a newer/compatible version of idf-component-manager?

Newer releases do update the component manager version. Meaning, this will get updated with v5.1.5.

It's looking more and more like this might be the easiest way for us to resolve this issue -- is there an ETA for a v5.1.5 framework-espidf platformio package?


Totally unrelated -- what is the logic to what IDF versions are released on platformio? 😅 It seems like IDF v4.4.x patches are being released with greater frequency than IDF v5.x, which seems backwards at this point in time. 😇 I must admit, I'm a bit puzzled why every 4.4.x version is available but 5.x.x releases are much more sparse.