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

[µTVM] Print .elf statistics for a model runtime built with Zephyr #7449

Merged
merged 5 commits into from
Feb 15, 2021

Commits on Feb 11, 2021

  1. [µTVM] Print .elf statistics for a model runtime built with Zephyr

    Currently there isn't any statistics about the used resources by a model
    runtime built with Zephyr, making it difficult to have any idea about, for
    instance, the amount of memory taken by the operations necessary to run the
    model.
    
    Since Zephyr's SDK already exposes the statistics about various memory
    regions on linking by passing '--print-memory-usage' to the linker, it's
    possible to use it to have an idea about the amount of memory used by the
    model and how much memory is left on the device.
    
    That commit adds a simple method to extract the memory region information
    out of the build output and then uses it to show memory usage statistics
    for various memory regions when Zephyr finishes building the image to be
    flashed to the target device.
    
    Signed-off-by: Gustavo Romero <[email protected]>
    gromero committed Feb 11, 2021
    Configuration menu
    Copy the full SHA
    555e95b View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2021

  1. v2: Fixes accordingly to Andrew review

    - Catch StopIteration in case of a weird output or no additional lines
      after the last memory region
    - Use of _LOG.info() instead of plain print() for better control over
      the output by the main script
    - Set log level in micro_tflite.py script as an example on how to get
      the new memory usage statistics and also because currently that's the
      main script used to test microTVM + Zephyr's SDK
    - Improve statistics header
    
    Signed-off-by: Gustavo Romero <[email protected]>
    gromero committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    1c8ad69 View commit details
    Browse the repository at this point in the history
  2. Fix build

    It seems build system is using Python < 3.7, so 'text' argument
    is not present as an alias for 'universal_newlines'. To satisfy
    it use old 'universal_newlines' argument which is available prior
    to Python 3.7.
    gromero committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    387a9eb View commit details
    Browse the repository at this point in the history
  3. Fix build

    Avoid exception anti-pattern when catching StopIteration
    gromero committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    39aece9 View commit details
    Browse the repository at this point in the history
  4. Retrigger CI

    gromero committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    6ebd7fe View commit details
    Browse the repository at this point in the history