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

TFLM compression documentation #2710

Closed
ddavis-2015 opened this issue Oct 2, 2024 · 1 comment
Closed

TFLM compression documentation #2710

ddavis-2015 opened this issue Oct 2, 2024 · 1 comment
Assignees

Comments

@ddavis-2015
Copy link
Member

@tensorflow/micro

Add documentation describing some compression/decompression internals and makefile build procedures.

@ddavis-2015 ddavis-2015 self-assigned this Oct 2, 2024
ddavis-2015 added a commit to ddavis-2015/tflite-micro that referenced this issue Oct 2, 2024
Add documentation describing some compression/decompression internals and makefile build procedures.

bug=TFLM compression documentation tensorflow#2710
mergify bot pushed a commit that referenced this issue Oct 3, 2024
@tensorflow/micro

Add documentation describing some compression/decompression internals and makefile build procedures.

bug=#2710
ddavis-2015 added a commit to ddavis-2015/tflite-micro that referenced this issue Oct 19, 2024
commit eaee851
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 17:48:48 2024 -0700

    Squashed commit of the following:

    commit 4894265
    Author: ddavis-2015 <[email protected]>
    Date:   Fri Oct 18 17:48:05 2024 -0700

        pre-merge empty commit

    commit a110e41
    Author: ddavis-2015 <[email protected]>
    Date:   Fri Oct 18 16:17:13 2024 -0700

        fix C++ bitwidth 6 & 7 decompression

    commit efedcc2
    Author: ddavis-2015 <[email protected]>
    Date:   Fri Oct 18 10:18:50 2024 -0700

        working decompression unit test

    commit 81ecf2e
    Author: ddavis-2015 <[email protected]>
    Date:   Thu Oct 17 18:17:06 2024 -0700

        decompression unit test improvements

    commit b318421
    Author: ddavis-2015 <[email protected]>
    Date:   Wed Oct 16 17:34:09 2024 -0700

        add decompression unit test

    commit 9bb2b63
    Author: ddavis-2015 <[email protected]>
    Date:   Sun Oct 13 18:34:01 2024 -0700

        cleanup

    commit 77bb05d
    Author: ddavis-2015 <[email protected]>
    Date:   Sun Oct 13 18:29:33 2024 -0700

        align compressed tensor data as per schema

    commit ad2b1c3
    Author: ddavis-2015 <[email protected]>
    Date:   Sat Oct 12 22:35:54 2024 -0700

        reduce HIFI5 decompression code size

    commit 99c6e35
    Author: ddavis-2015 <[email protected]>
    Date:   Fri Oct 11 14:02:58 2024 -0700

        revert to original Cadence bit width 4 code

    commit 2388549
    Author: ddavis-2015 <[email protected]>
    Date:   Thu Oct 10 17:50:29 2024 -0700

        refactor decompression code into reference and platform specific
        Apply some Xtensa acceleration code changes

    commit b84853c
    Author: ddavis-2015 <[email protected]>
    Date:   Tue Oct 8 16:08:55 2024 -0700

        testing

commit c107f42
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 17 14:31:03 2024 -0500

    refactor: move misplaced TF_LITE_REMOVE_VIRTUAL_DELETEs to private:

    Move several TF_LITE_REMOVE_VIRTUAL_DELETE declarations that are
    wrongly in a public section of their classes. To have the intended
    effect, as documented in t/l/m/compatibility.h, these must be in a
    private section.

commit 7b3a2bd
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 17 12:36:46 2024 -0500

    build(bazel): always build with TF_LITE_STATIC_MEMORY

    Add TF_LITE_STATIC_MEMORY to the defines set globally for TFLM builds in
    Bazel. TFLM always builds with this set in Make, and it appears to have
    been an oversight that it wasn't set during Bazel builds. Not having it
    set in Bazel caused some unit tests to pass under Bazel that failed
    under Make.

    At the same time, add -fno-exceptions. This flag is also always set in
    Make builds. Without it, setting TF_LITE_STATIC_MEMORY breaks the build.
    TF_LITE_STATIC_MEMORY triggers TF_LITE_REMOVE_VIRTUAL_DELETE in
    t/l/m/compatibility.h, which makes operator delete private in certain
    classes. When exceptions are enabled, a placement new with those classes
    is allowed to throw an exception, and operator delete is implicitly
    called during the unwind. The build breaks because operator delete can't
    be called if it's private. Disabling exceptions eliminates the unwind
    code that calls operator delete implicitly, and thus the build succeeds.

    In any case, -fno-exceptions should have been used in Bazel builds,
    matching the flags used in Make and the no-exceptions design requirement
    of the TFLM project.

commit 1eb4e0d
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 17 11:05:45 2024 -0500

    feat(python): don't check .sparsity in interpreter

    Remove the check for sparse tensors in the Python interpreter wrapper.
    This fixes a broken build when TF_LITE_STATIC_MEMORY is set, which
    should always be the case in TFLM. TfLiteTensor objects don't have a
    .sparsity member when TF_LITE_STATIC_MEMORY is set.

    This prepares for an upcoming commit setting TF_LITE_STATIC_MEMORY
    during Bazel builds. This hasn't caused build failures in Make builds,
    which have always set TF_LITE_STATIC_MEMORY, because Make builds don't
    build the Python interpreter wrapper.

commit 7217095
Author: Ryan Kuester <[email protected]>
Date:   Wed Oct 16 14:03:25 2024 -0500

    fix(memory_arena_threshold): with TF_LITE_STATIC_MEMORY

    Fix the broken build due to redefinition of the threshold when
    TF_LITE_STATIC_MEMORY is set. Apparently this case isn't triggered in
    any Bazel test, only in Make.

    Simplify the threshold specification by only depending on whether
    compression is enabled and not also on whether TF_LITE_STATIC_MEMORY is
    in use.

commit 8e4e55e
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 10 12:38:03 2024 -0500

    build(bazel): disable codegen when building --//:with_compression

    The codegen prototype code is not compatible with the changes which
    implement model compression made to the core TFLM components. For now,
    disable codegen targets when building with compression enabled.

commit 884a234
Author: Ryan Kuester <[email protected]>
Date:   Tue Oct 15 18:31:01 2024 -0500

    build(bazel): compile in compression when --//:with_compression

    Conditionally compile in support for compressed tensors when the option
    --//:with_compression is given.

commit a1d459b
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 10 12:28:39 2024 -0500

    build(bazel): add --//with_compression build setting

    Add a --//with_compression user-defined build setting and a
    corresponding configuration setting.

commit 4edc564
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 10 12:24:53 2024 -0500

    build(bazel): fix compression-related dependencies of micro_allocator

commit a52f97f
Author: Ryan Kuester <[email protected]>
Date:   Tue Oct 15 17:28:09 2024 -0500

    build(bazel): replace cc_* with tflm_cc_* in remaining TFLM code

    Replace cc_* targets remaining in TFLM code with tflm_cc_* targets.
    These are targets which did not formerly use the common copts. Avoid
    changing imported TFLite code, if for no other reason than to avoid
    merge conflicts during the automatic sync with upstream TFLite.

commit a6368f4
Author: Ryan Kuester <[email protected]>
Date:   Fri Oct 11 16:08:34 2024 -0500

    build(bazel): introduce tflm_cc_* macros, refactoring away micro_copts

    Remove micro_copts() by replacing every cc_* target that used
    them with a tflm_cc_* equivalent, and setting those common copts in one
    place, inside the tflm_cc_* macro.

    This is the first of several commits introducing tflm_cc_* macros in
    place of cc_binary, cc_library, and cc_test. Motivated by the upcoming
    need to support conditional compilation, the objective is to centralize
    build configuration rather than requiring (and remembering that) each
    cc_* target in the project add the same common attributes such as
    compiler options and select()ed #defines.

    Alternatives such as setting global options on the command line or in
    .bazelrc, even if simplified with a --config option, fail to preserve
    flags and hooks for configuration in the case TFLM is used as an
    external repository by an application project. Nor is it easy in that
    case for individual targets to override an otherwise global setting.

commit 1518422
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 10 23:56:49 2024 -0500

    chore: remove obsolete ci/temp_patches

    Remove ci/temp_patches, which was obsoleted in 23f608f once it
    was no longer used by the sync script. It should have been
    deleted then.

    Remove it not only to clean up dead code, but because it contains
    a reference to `micro_copts`, which is about to be refactored
    away, and we don't want to leave stray references to it in the
    tree.

commit 18ef080
Author: Ryan Kuester <[email protected]>
Date:   Tue Oct 8 17:58:12 2024 -0500

    refactor: use metadata_saved.h instead of metadata_generated.h

    Use the generated file metadata_saved.h instead of metadata_generated.h
    for the reasons explained in t/l/m/compression/BUILD:metadata_saved.
    Delete metadata_generated.h from the source tree as it is not
    maintained.

commit 5a02e30
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 10 13:46:46 2024 -0500

    test(memory_arena_threshold): adjust expected value with compression

    Fix a test failure by setting a different expected value for the
    persistent buffer allocation when compression is configured in. The
    allocation was allowed to vary by 3%; however, compression adds ~10%.
    Set the expected value to the measured value when compression is
    configured in.

commit 01bc582
Author: Ryan Kuester <[email protected]>
Date:   Thu Oct 10 13:35:10 2024 -0500

    test(memory_arena_threshold): don't expect exact allocation values

    Remove the check for allocation sizes to exactly match expected values.
    This check immediately followed--and thus rendered pointless---a check
    that sizes are within a certain percentage, which seems to be the true
    intent of the test.

commit e0aae77
Merge: e328029 e86d97b
Author: Ryan Kuester <[email protected]>
Date:   Wed Oct 16 13:39:56 2024 -0500

    Merge branch 'main' into compress-testing

commit e328029
Author: Ryan Kuester <[email protected]>
Date:   Mon Oct 7 12:52:23 2024 -0500

    build(bazel): fix dependencies in work-in-progress compression code

    In the Bazel build, add dependencies needed by the code added to
    t/l/m:micro_context for decompression. The Bazel build with or without
    compression was broken without this.

commit e86d97b
Author: RJ Ascani <[email protected]>
Date:   Mon Oct 7 10:36:26 2024 -0700

    Replace rascani with suleshahid on OWNERS (tensorflow#2715)

    BUG=none

commit b773428
Author: Ryan Kuester <[email protected]>
Date:   Fri Oct 4 09:59:10 2024 -0500

    feat(compression): add work-in-progress compression and viewer tools

commit f6bd486
Merge: 487c17a e3f6dc1
Author: Ryan Kuester <[email protected]>
Date:   Fri Oct 4 09:36:24 2024 -0500

    Merge branch 'main' into compress-prerelease

commit e3f6dc1
Author: David Davis <[email protected]>
Date:   Thu Oct 3 10:45:00 2024 -0700

    Compression documentation (tensorflow#2711)

    @tensorflow/micro

    Add documentation describing some compression/decompression internals and makefile build procedures.

    bug=tensorflow#2710

commit b3967a9
Author: Ryan Kuester <[email protected]>
Date:   Wed Oct 2 13:36:01 2024 -0500

    style: add .style.yapf to control yapf styling of Python code (tensorflow#2709)

    Add a .style.yapf file so yapf can be used to style Python code without
    passing the project's style via command line option. Remove the
    corresponding patch to pigweed's call to yapf, used by CI, and instead
    let it too rely on .style.yapf. Remove the developer documentation's
    instruction to use the command line option.

    BUG=description

commit d249577
Author: Ryan Kuester <[email protected]>
Date:   Tue Oct 1 16:16:45 2024 -0500

    build(codegen): suppress noise in console output (tensorflow#2708)

    Add a --quiet option to the code_generator binary so that when it's used
    within the build system, it doesn't print unexpected, distracting noise
    to the console. Generally, compiler or generator commands don't print
    output unless there's an error.

    BUG=description
ddavis-2015 added a commit to rkuester/tflite-micro that referenced this issue Oct 21, 2024
commit b43c16c
Author: ddavis-2015 <[email protected]>
Date:   Mon Oct 21 05:05:15 2024 -0700

    fix code style errors.

commit 2d825e3
Author: ddavis-2015 <[email protected]>
Date:   Mon Oct 21 04:09:39 2024 -0700

    fix code style errors.
    fix BUILD file style errors.

commit 459569a
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 19:17:43 2024 -0700

    use kernel optimzer level -O3 and -LNO:simd for Xtensa HIFI5

commit 122db20
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 19:07:19 2024 -0700

    add compression build/test to bazel default test script

commit d96b614
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 18:56:31 2024 -0700

    fix CI code style errors
    fix CI BUILD file style errors

commit 821dfdf
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 12:19:34 2024 -0700

    Cleanup header file usage.
    Add decompression code to Bazel BUILD files

commit 4a02b22
Author: ddavis-2015 <[email protected]>
Date:   Sat Oct 19 13:31:11 2024 -0700

    cleanup

commit 3d765e6
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 18:01:21 2024 -0700

    Squashed commit of the following:

    commit eaee851
    Author: ddavis-2015 <[email protected]>
    Date:   Fri Oct 18 17:48:48 2024 -0700

        Squashed commit of the following:

        commit 4894265
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 17:48:05 2024 -0700

            pre-merge empty commit

        commit a110e41
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 16:17:13 2024 -0700

            fix C++ bitwidth 6 & 7 decompression

        commit efedcc2
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 10:18:50 2024 -0700

            working decompression unit test

        commit 81ecf2e
        Author: ddavis-2015 <[email protected]>
        Date:   Thu Oct 17 18:17:06 2024 -0700

            decompression unit test improvements

        commit b318421
        Author: ddavis-2015 <[email protected]>
        Date:   Wed Oct 16 17:34:09 2024 -0700

            add decompression unit test

        commit 9bb2b63
        Author: ddavis-2015 <[email protected]>
        Date:   Sun Oct 13 18:34:01 2024 -0700

            cleanup

        commit 77bb05d
        Author: ddavis-2015 <[email protected]>
        Date:   Sun Oct 13 18:29:33 2024 -0700

            align compressed tensor data as per schema

        commit ad2b1c3
        Author: ddavis-2015 <[email protected]>
        Date:   Sat Oct 12 22:35:54 2024 -0700

            reduce HIFI5 decompression code size

        commit 99c6e35
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 11 14:02:58 2024 -0700

            revert to original Cadence bit width 4 code

        commit 2388549
        Author: ddavis-2015 <[email protected]>
        Date:   Thu Oct 10 17:50:29 2024 -0700

            refactor decompression code into reference and platform specific
            Apply some Xtensa acceleration code changes

        commit b84853c
        Author: ddavis-2015 <[email protected]>
        Date:   Tue Oct 8 16:08:55 2024 -0700

            testing

    commit c107f42
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 14:31:03 2024 -0500

        refactor: move misplaced TF_LITE_REMOVE_VIRTUAL_DELETEs to private:

        Move several TF_LITE_REMOVE_VIRTUAL_DELETE declarations that are
        wrongly in a public section of their classes. To have the intended
        effect, as documented in t/l/m/compatibility.h, these must be in a
        private section.

    commit 7b3a2bd
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 12:36:46 2024 -0500

        build(bazel): always build with TF_LITE_STATIC_MEMORY

        Add TF_LITE_STATIC_MEMORY to the defines set globally for TFLM builds in
        Bazel. TFLM always builds with this set in Make, and it appears to have
        been an oversight that it wasn't set during Bazel builds. Not having it
        set in Bazel caused some unit tests to pass under Bazel that failed
        under Make.

        At the same time, add -fno-exceptions. This flag is also always set in
        Make builds. Without it, setting TF_LITE_STATIC_MEMORY breaks the build.
        TF_LITE_STATIC_MEMORY triggers TF_LITE_REMOVE_VIRTUAL_DELETE in
        t/l/m/compatibility.h, which makes operator delete private in certain
        classes. When exceptions are enabled, a placement new with those classes
        is allowed to throw an exception, and operator delete is implicitly
        called during the unwind. The build breaks because operator delete can't
        be called if it's private. Disabling exceptions eliminates the unwind
        code that calls operator delete implicitly, and thus the build succeeds.

        In any case, -fno-exceptions should have been used in Bazel builds,
        matching the flags used in Make and the no-exceptions design requirement
        of the TFLM project.

    commit 1eb4e0d
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 11:05:45 2024 -0500

        feat(python): don't check .sparsity in interpreter

        Remove the check for sparse tensors in the Python interpreter wrapper.
        This fixes a broken build when TF_LITE_STATIC_MEMORY is set, which
        should always be the case in TFLM. TfLiteTensor objects don't have a
        .sparsity member when TF_LITE_STATIC_MEMORY is set.

        This prepares for an upcoming commit setting TF_LITE_STATIC_MEMORY
        during Bazel builds. This hasn't caused build failures in Make builds,
        which have always set TF_LITE_STATIC_MEMORY, because Make builds don't
        build the Python interpreter wrapper.

    commit 7217095
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 16 14:03:25 2024 -0500

        fix(memory_arena_threshold): with TF_LITE_STATIC_MEMORY

        Fix the broken build due to redefinition of the threshold when
        TF_LITE_STATIC_MEMORY is set. Apparently this case isn't triggered in
        any Bazel test, only in Make.

        Simplify the threshold specification by only depending on whether
        compression is enabled and not also on whether TF_LITE_STATIC_MEMORY is
        in use.

    commit 8e4e55e
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:38:03 2024 -0500

        build(bazel): disable codegen when building --//:with_compression

        The codegen prototype code is not compatible with the changes which
        implement model compression made to the core TFLM components. For now,
        disable codegen targets when building with compression enabled.

    commit 884a234
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 15 18:31:01 2024 -0500

        build(bazel): compile in compression when --//:with_compression

        Conditionally compile in support for compressed tensors when the option
        --//:with_compression is given.

    commit a1d459b
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:28:39 2024 -0500

        build(bazel): add --//with_compression build setting

        Add a --//with_compression user-defined build setting and a
        corresponding configuration setting.

    commit 4edc564
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:24:53 2024 -0500

        build(bazel): fix compression-related dependencies of micro_allocator

    commit a52f97f
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 15 17:28:09 2024 -0500

        build(bazel): replace cc_* with tflm_cc_* in remaining TFLM code

        Replace cc_* targets remaining in TFLM code with tflm_cc_* targets.
        These are targets which did not formerly use the common copts. Avoid
        changing imported TFLite code, if for no other reason than to avoid
        merge conflicts during the automatic sync with upstream TFLite.

    commit a6368f4
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 11 16:08:34 2024 -0500

        build(bazel): introduce tflm_cc_* macros, refactoring away micro_copts

        Remove micro_copts() by replacing every cc_* target that used
        them with a tflm_cc_* equivalent, and setting those common copts in one
        place, inside the tflm_cc_* macro.

        This is the first of several commits introducing tflm_cc_* macros in
        place of cc_binary, cc_library, and cc_test. Motivated by the upcoming
        need to support conditional compilation, the objective is to centralize
        build configuration rather than requiring (and remembering that) each
        cc_* target in the project add the same common attributes such as
        compiler options and select()ed #defines.

        Alternatives such as setting global options on the command line or in
        .bazelrc, even if simplified with a --config option, fail to preserve
        flags and hooks for configuration in the case TFLM is used as an
        external repository by an application project. Nor is it easy in that
        case for individual targets to override an otherwise global setting.

    commit 1518422
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 23:56:49 2024 -0500

        chore: remove obsolete ci/temp_patches

        Remove ci/temp_patches, which was obsoleted in 23f608f once it
        was no longer used by the sync script. It should have been
        deleted then.

        Remove it not only to clean up dead code, but because it contains
        a reference to `micro_copts`, which is about to be refactored
        away, and we don't want to leave stray references to it in the
        tree.

    commit 18ef080
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 8 17:58:12 2024 -0500

        refactor: use metadata_saved.h instead of metadata_generated.h

        Use the generated file metadata_saved.h instead of metadata_generated.h
        for the reasons explained in t/l/m/compression/BUILD:metadata_saved.
        Delete metadata_generated.h from the source tree as it is not
        maintained.

    commit 5a02e30
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 13:46:46 2024 -0500

        test(memory_arena_threshold): adjust expected value with compression

        Fix a test failure by setting a different expected value for the
        persistent buffer allocation when compression is configured in. The
        allocation was allowed to vary by 3%; however, compression adds ~10%.
        Set the expected value to the measured value when compression is
        configured in.

    commit 01bc582
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 13:35:10 2024 -0500

        test(memory_arena_threshold): don't expect exact allocation values

        Remove the check for allocation sizes to exactly match expected values.
        This check immediately followed--and thus rendered pointless---a check
        that sizes are within a certain percentage, which seems to be the true
        intent of the test.

    commit e0aae77
    Merge: e328029 e86d97b
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 16 13:39:56 2024 -0500

        Merge branch 'main' into compress-testing

    commit e328029
    Author: Ryan Kuester <[email protected]>
    Date:   Mon Oct 7 12:52:23 2024 -0500

        build(bazel): fix dependencies in work-in-progress compression code

        In the Bazel build, add dependencies needed by the code added to
        t/l/m:micro_context for decompression. The Bazel build with or without
        compression was broken without this.

    commit e86d97b
    Author: RJ Ascani <[email protected]>
    Date:   Mon Oct 7 10:36:26 2024 -0700

        Replace rascani with suleshahid on OWNERS (tensorflow#2715)

        BUG=none

    commit b773428
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 4 09:59:10 2024 -0500

        feat(compression): add work-in-progress compression and viewer tools

    commit f6bd486
    Merge: 487c17a e3f6dc1
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 4 09:36:24 2024 -0500

        Merge branch 'main' into compress-prerelease

    commit e3f6dc1
    Author: David Davis <[email protected]>
    Date:   Thu Oct 3 10:45:00 2024 -0700

        Compression documentation (tensorflow#2711)

        @tensorflow/micro

        Add documentation describing some compression/decompression internals and makefile build procedures.

        bug=tensorflow#2710

    commit b3967a9
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 2 13:36:01 2024 -0500

        style: add .style.yapf to control yapf styling of Python code (tensorflow#2709)

        Add a .style.yapf file so yapf can be used to style Python code without
        passing the project's style via command line option. Remove the
        corresponding patch to pigweed's call to yapf, used by CI, and instead
        let it too rely on .style.yapf. Remove the developer documentation's
        instruction to use the command line option.

        BUG=description

    commit d249577
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 1 16:16:45 2024 -0500

        build(codegen): suppress noise in console output (tensorflow#2708)

        Add a --quiet option to the code_generator binary so that when it's used
        within the build system, it doesn't print unexpected, distracting noise
        to the console. Generally, compiler or generator commands don't print
        output unless there's an error.

        BUG=description

commit 4894265
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 17:48:05 2024 -0700

    pre-merge empty commit

commit a110e41
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 16:17:13 2024 -0700

    fix C++ bitwidth 6 & 7 decompression

commit efedcc2
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 10:18:50 2024 -0700

    working decompression unit test

commit 81ecf2e
Author: ddavis-2015 <[email protected]>
Date:   Thu Oct 17 18:17:06 2024 -0700

    decompression unit test improvements

commit b318421
Author: ddavis-2015 <[email protected]>
Date:   Wed Oct 16 17:34:09 2024 -0700

    add decompression unit test

commit 9bb2b63
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 13 18:34:01 2024 -0700

    cleanup

commit 77bb05d
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 13 18:29:33 2024 -0700

    align compressed tensor data as per schema

commit ad2b1c3
Author: ddavis-2015 <[email protected]>
Date:   Sat Oct 12 22:35:54 2024 -0700

    reduce HIFI5 decompression code size

commit 99c6e35
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 11 14:02:58 2024 -0700

    revert to original Cadence bit width 4 code

commit 2388549
Author: ddavis-2015 <[email protected]>
Date:   Thu Oct 10 17:50:29 2024 -0700

    refactor decompression code into reference and platform specific
    Apply some Xtensa acceleration code changes

commit b84853c
Author: ddavis-2015 <[email protected]>
Date:   Tue Oct 8 16:08:55 2024 -0700

    testing
ddavis-2015 added a commit to rkuester/tflite-micro that referenced this issue Oct 23, 2024
commit df29a4c
Author: ddavis-2015 <[email protected]>
Date:   Wed Oct 23 03:47:27 2024 -0700

    header file cleanup.

commit 7dc34a9
Author: ddavis-2015 <[email protected]>
Date:   Mon Oct 21 17:16:24 2024 -0700

    update to latest Cadence decompression code.

commit b43c16c
Author: ddavis-2015 <[email protected]>
Date:   Mon Oct 21 05:05:15 2024 -0700

    fix code style errors.

commit 2d825e3
Author: ddavis-2015 <[email protected]>
Date:   Mon Oct 21 04:09:39 2024 -0700

    fix code style errors.
    fix BUILD file style errors.

commit 459569a
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 19:17:43 2024 -0700

    use kernel optimzer level -O3 and -LNO:simd for Xtensa HIFI5

commit 122db20
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 19:07:19 2024 -0700

    add compression build/test to bazel default test script

commit d96b614
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 18:56:31 2024 -0700

    fix CI code style errors
    fix CI BUILD file style errors

commit 821dfdf
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 12:19:34 2024 -0700

    Cleanup header file usage.
    Add decompression code to Bazel BUILD files

commit 4a02b22
Author: ddavis-2015 <[email protected]>
Date:   Sat Oct 19 13:31:11 2024 -0700

    cleanup

commit 3d765e6
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 18:01:21 2024 -0700

    Squashed commit of the following:

    commit eaee851
    Author: ddavis-2015 <[email protected]>
    Date:   Fri Oct 18 17:48:48 2024 -0700

        Squashed commit of the following:

        commit 4894265
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 17:48:05 2024 -0700

            pre-merge empty commit

        commit a110e41
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 16:17:13 2024 -0700

            fix C++ bitwidth 6 & 7 decompression

        commit efedcc2
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 10:18:50 2024 -0700

            working decompression unit test

        commit 81ecf2e
        Author: ddavis-2015 <[email protected]>
        Date:   Thu Oct 17 18:17:06 2024 -0700

            decompression unit test improvements

        commit b318421
        Author: ddavis-2015 <[email protected]>
        Date:   Wed Oct 16 17:34:09 2024 -0700

            add decompression unit test

        commit 9bb2b63
        Author: ddavis-2015 <[email protected]>
        Date:   Sun Oct 13 18:34:01 2024 -0700

            cleanup

        commit 77bb05d
        Author: ddavis-2015 <[email protected]>
        Date:   Sun Oct 13 18:29:33 2024 -0700

            align compressed tensor data as per schema

        commit ad2b1c3
        Author: ddavis-2015 <[email protected]>
        Date:   Sat Oct 12 22:35:54 2024 -0700

            reduce HIFI5 decompression code size

        commit 99c6e35
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 11 14:02:58 2024 -0700

            revert to original Cadence bit width 4 code

        commit 2388549
        Author: ddavis-2015 <[email protected]>
        Date:   Thu Oct 10 17:50:29 2024 -0700

            refactor decompression code into reference and platform specific
            Apply some Xtensa acceleration code changes

        commit b84853c
        Author: ddavis-2015 <[email protected]>
        Date:   Tue Oct 8 16:08:55 2024 -0700

            testing

    commit c107f42
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 14:31:03 2024 -0500

        refactor: move misplaced TF_LITE_REMOVE_VIRTUAL_DELETEs to private:

        Move several TF_LITE_REMOVE_VIRTUAL_DELETE declarations that are
        wrongly in a public section of their classes. To have the intended
        effect, as documented in t/l/m/compatibility.h, these must be in a
        private section.

    commit 7b3a2bd
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 12:36:46 2024 -0500

        build(bazel): always build with TF_LITE_STATIC_MEMORY

        Add TF_LITE_STATIC_MEMORY to the defines set globally for TFLM builds in
        Bazel. TFLM always builds with this set in Make, and it appears to have
        been an oversight that it wasn't set during Bazel builds. Not having it
        set in Bazel caused some unit tests to pass under Bazel that failed
        under Make.

        At the same time, add -fno-exceptions. This flag is also always set in
        Make builds. Without it, setting TF_LITE_STATIC_MEMORY breaks the build.
        TF_LITE_STATIC_MEMORY triggers TF_LITE_REMOVE_VIRTUAL_DELETE in
        t/l/m/compatibility.h, which makes operator delete private in certain
        classes. When exceptions are enabled, a placement new with those classes
        is allowed to throw an exception, and operator delete is implicitly
        called during the unwind. The build breaks because operator delete can't
        be called if it's private. Disabling exceptions eliminates the unwind
        code that calls operator delete implicitly, and thus the build succeeds.

        In any case, -fno-exceptions should have been used in Bazel builds,
        matching the flags used in Make and the no-exceptions design requirement
        of the TFLM project.

    commit 1eb4e0d
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 11:05:45 2024 -0500

        feat(python): don't check .sparsity in interpreter

        Remove the check for sparse tensors in the Python interpreter wrapper.
        This fixes a broken build when TF_LITE_STATIC_MEMORY is set, which
        should always be the case in TFLM. TfLiteTensor objects don't have a
        .sparsity member when TF_LITE_STATIC_MEMORY is set.

        This prepares for an upcoming commit setting TF_LITE_STATIC_MEMORY
        during Bazel builds. This hasn't caused build failures in Make builds,
        which have always set TF_LITE_STATIC_MEMORY, because Make builds don't
        build the Python interpreter wrapper.

    commit 7217095
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 16 14:03:25 2024 -0500

        fix(memory_arena_threshold): with TF_LITE_STATIC_MEMORY

        Fix the broken build due to redefinition of the threshold when
        TF_LITE_STATIC_MEMORY is set. Apparently this case isn't triggered in
        any Bazel test, only in Make.

        Simplify the threshold specification by only depending on whether
        compression is enabled and not also on whether TF_LITE_STATIC_MEMORY is
        in use.

    commit 8e4e55e
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:38:03 2024 -0500

        build(bazel): disable codegen when building --//:with_compression

        The codegen prototype code is not compatible with the changes which
        implement model compression made to the core TFLM components. For now,
        disable codegen targets when building with compression enabled.

    commit 884a234
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 15 18:31:01 2024 -0500

        build(bazel): compile in compression when --//:with_compression

        Conditionally compile in support for compressed tensors when the option
        --//:with_compression is given.

    commit a1d459b
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:28:39 2024 -0500

        build(bazel): add --//with_compression build setting

        Add a --//with_compression user-defined build setting and a
        corresponding configuration setting.

    commit 4edc564
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:24:53 2024 -0500

        build(bazel): fix compression-related dependencies of micro_allocator

    commit a52f97f
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 15 17:28:09 2024 -0500

        build(bazel): replace cc_* with tflm_cc_* in remaining TFLM code

        Replace cc_* targets remaining in TFLM code with tflm_cc_* targets.
        These are targets which did not formerly use the common copts. Avoid
        changing imported TFLite code, if for no other reason than to avoid
        merge conflicts during the automatic sync with upstream TFLite.

    commit a6368f4
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 11 16:08:34 2024 -0500

        build(bazel): introduce tflm_cc_* macros, refactoring away micro_copts

        Remove micro_copts() by replacing every cc_* target that used
        them with a tflm_cc_* equivalent, and setting those common copts in one
        place, inside the tflm_cc_* macro.

        This is the first of several commits introducing tflm_cc_* macros in
        place of cc_binary, cc_library, and cc_test. Motivated by the upcoming
        need to support conditional compilation, the objective is to centralize
        build configuration rather than requiring (and remembering that) each
        cc_* target in the project add the same common attributes such as
        compiler options and select()ed #defines.

        Alternatives such as setting global options on the command line or in
        .bazelrc, even if simplified with a --config option, fail to preserve
        flags and hooks for configuration in the case TFLM is used as an
        external repository by an application project. Nor is it easy in that
        case for individual targets to override an otherwise global setting.

    commit 1518422
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 23:56:49 2024 -0500

        chore: remove obsolete ci/temp_patches

        Remove ci/temp_patches, which was obsoleted in 23f608f once it
        was no longer used by the sync script. It should have been
        deleted then.

        Remove it not only to clean up dead code, but because it contains
        a reference to `micro_copts`, which is about to be refactored
        away, and we don't want to leave stray references to it in the
        tree.

    commit 18ef080
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 8 17:58:12 2024 -0500

        refactor: use metadata_saved.h instead of metadata_generated.h

        Use the generated file metadata_saved.h instead of metadata_generated.h
        for the reasons explained in t/l/m/compression/BUILD:metadata_saved.
        Delete metadata_generated.h from the source tree as it is not
        maintained.

    commit 5a02e30
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 13:46:46 2024 -0500

        test(memory_arena_threshold): adjust expected value with compression

        Fix a test failure by setting a different expected value for the
        persistent buffer allocation when compression is configured in. The
        allocation was allowed to vary by 3%; however, compression adds ~10%.
        Set the expected value to the measured value when compression is
        configured in.

    commit 01bc582
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 13:35:10 2024 -0500

        test(memory_arena_threshold): don't expect exact allocation values

        Remove the check for allocation sizes to exactly match expected values.
        This check immediately followed--and thus rendered pointless---a check
        that sizes are within a certain percentage, which seems to be the true
        intent of the test.

    commit e0aae77
    Merge: e328029 e86d97b
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 16 13:39:56 2024 -0500

        Merge branch 'main' into compress-testing

    commit e328029
    Author: Ryan Kuester <[email protected]>
    Date:   Mon Oct 7 12:52:23 2024 -0500

        build(bazel): fix dependencies in work-in-progress compression code

        In the Bazel build, add dependencies needed by the code added to
        t/l/m:micro_context for decompression. The Bazel build with or without
        compression was broken without this.

    commit e86d97b
    Author: RJ Ascani <[email protected]>
    Date:   Mon Oct 7 10:36:26 2024 -0700

        Replace rascani with suleshahid on OWNERS (tensorflow#2715)

        BUG=none

    commit b773428
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 4 09:59:10 2024 -0500

        feat(compression): add work-in-progress compression and viewer tools

    commit f6bd486
    Merge: 487c17a e3f6dc1
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 4 09:36:24 2024 -0500

        Merge branch 'main' into compress-prerelease

    commit e3f6dc1
    Author: David Davis <[email protected]>
    Date:   Thu Oct 3 10:45:00 2024 -0700

        Compression documentation (tensorflow#2711)

        @tensorflow/micro

        Add documentation describing some compression/decompression internals and makefile build procedures.

        bug=tensorflow#2710

    commit b3967a9
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 2 13:36:01 2024 -0500

        style: add .style.yapf to control yapf styling of Python code (tensorflow#2709)

        Add a .style.yapf file so yapf can be used to style Python code without
        passing the project's style via command line option. Remove the
        corresponding patch to pigweed's call to yapf, used by CI, and instead
        let it too rely on .style.yapf. Remove the developer documentation's
        instruction to use the command line option.

        BUG=description

    commit d249577
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 1 16:16:45 2024 -0500

        build(codegen): suppress noise in console output (tensorflow#2708)

        Add a --quiet option to the code_generator binary so that when it's used
        within the build system, it doesn't print unexpected, distracting noise
        to the console. Generally, compiler or generator commands don't print
        output unless there's an error.

        BUG=description

commit 4894265
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 17:48:05 2024 -0700

    pre-merge empty commit

commit a110e41
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 16:17:13 2024 -0700

    fix C++ bitwidth 6 & 7 decompression

commit efedcc2
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 10:18:50 2024 -0700

    working decompression unit test

commit 81ecf2e
Author: ddavis-2015 <[email protected]>
Date:   Thu Oct 17 18:17:06 2024 -0700

    decompression unit test improvements

commit b318421
Author: ddavis-2015 <[email protected]>
Date:   Wed Oct 16 17:34:09 2024 -0700

    add decompression unit test

commit 9bb2b63
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 13 18:34:01 2024 -0700

    cleanup

commit 77bb05d
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 13 18:29:33 2024 -0700

    align compressed tensor data as per schema

commit ad2b1c3
Author: ddavis-2015 <[email protected]>
Date:   Sat Oct 12 22:35:54 2024 -0700

    reduce HIFI5 decompression code size

commit 99c6e35
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 11 14:02:58 2024 -0700

    revert to original Cadence bit width 4 code

commit 2388549
Author: ddavis-2015 <[email protected]>
Date:   Thu Oct 10 17:50:29 2024 -0700

    refactor decompression code into reference and platform specific
    Apply some Xtensa acceleration code changes

commit b84853c
Author: ddavis-2015 <[email protected]>
Date:   Tue Oct 8 16:08:55 2024 -0700

    testing
Copy link
Contributor

"This issue is being marked as stale due to inactivity. Remove label or comment to prevent closure in 5 days."

@github-actions github-actions bot added the Stale label Oct 28, 2024
@ddavis-2015 ddavis-2015 removed the Stale label Oct 30, 2024
ddavis-2015 added a commit to rkuester/tflite-micro that referenced this issue Nov 1, 2024
commit 4dca8e7
Author: ddavis-2015 <[email protected]>
Date:   Thu Oct 31 02:10:17 2024 -0700

    keep generic benchmark application binary size stable regardless of whether compression is enabled

commit ac4a0a4
Author: ddavis-2015 <[email protected]>
Date:   Thu Oct 31 01:49:40 2024 -0700

    cleanup

commit fc4b473
Author: ddavis-2015 <[email protected]>
Date:   Wed Oct 30 04:19:07 2024 -0700

    additional operator relocation check.

commit 8c53ee3
Author: ddavis-2015 <[email protected]>
Date:   Tue Oct 29 17:17:11 2024 -0700

    first cut at op relocation script.
    expand model_facade.
    fix greedy memory planner debug output.

commit df29a4c
Author: ddavis-2015 <[email protected]>
Date:   Wed Oct 23 03:47:27 2024 -0700

    header file cleanup.

commit 7dc34a9
Author: ddavis-2015 <[email protected]>
Date:   Mon Oct 21 17:16:24 2024 -0700

    update to latest Cadence decompression code.

commit b43c16c
Author: ddavis-2015 <[email protected]>
Date:   Mon Oct 21 05:05:15 2024 -0700

    fix code style errors.

commit 2d825e3
Author: ddavis-2015 <[email protected]>
Date:   Mon Oct 21 04:09:39 2024 -0700

    fix code style errors.
    fix BUILD file style errors.

commit 459569a
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 19:17:43 2024 -0700

    use kernel optimzer level -O3 and -LNO:simd for Xtensa HIFI5

commit 122db20
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 19:07:19 2024 -0700

    add compression build/test to bazel default test script

commit d96b614
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 18:56:31 2024 -0700

    fix CI code style errors
    fix CI BUILD file style errors

commit 821dfdf
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 20 12:19:34 2024 -0700

    Cleanup header file usage.
    Add decompression code to Bazel BUILD files

commit 4a02b22
Author: ddavis-2015 <[email protected]>
Date:   Sat Oct 19 13:31:11 2024 -0700

    cleanup

commit 3d765e6
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 18:01:21 2024 -0700

    Squashed commit of the following:

    commit eaee851
    Author: ddavis-2015 <[email protected]>
    Date:   Fri Oct 18 17:48:48 2024 -0700

        Squashed commit of the following:

        commit 4894265
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 17:48:05 2024 -0700

            pre-merge empty commit

        commit a110e41
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 16:17:13 2024 -0700

            fix C++ bitwidth 6 & 7 decompression

        commit efedcc2
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 18 10:18:50 2024 -0700

            working decompression unit test

        commit 81ecf2e
        Author: ddavis-2015 <[email protected]>
        Date:   Thu Oct 17 18:17:06 2024 -0700

            decompression unit test improvements

        commit b318421
        Author: ddavis-2015 <[email protected]>
        Date:   Wed Oct 16 17:34:09 2024 -0700

            add decompression unit test

        commit 9bb2b63
        Author: ddavis-2015 <[email protected]>
        Date:   Sun Oct 13 18:34:01 2024 -0700

            cleanup

        commit 77bb05d
        Author: ddavis-2015 <[email protected]>
        Date:   Sun Oct 13 18:29:33 2024 -0700

            align compressed tensor data as per schema

        commit ad2b1c3
        Author: ddavis-2015 <[email protected]>
        Date:   Sat Oct 12 22:35:54 2024 -0700

            reduce HIFI5 decompression code size

        commit 99c6e35
        Author: ddavis-2015 <[email protected]>
        Date:   Fri Oct 11 14:02:58 2024 -0700

            revert to original Cadence bit width 4 code

        commit 2388549
        Author: ddavis-2015 <[email protected]>
        Date:   Thu Oct 10 17:50:29 2024 -0700

            refactor decompression code into reference and platform specific
            Apply some Xtensa acceleration code changes

        commit b84853c
        Author: ddavis-2015 <[email protected]>
        Date:   Tue Oct 8 16:08:55 2024 -0700

            testing

    commit c107f42
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 14:31:03 2024 -0500

        refactor: move misplaced TF_LITE_REMOVE_VIRTUAL_DELETEs to private:

        Move several TF_LITE_REMOVE_VIRTUAL_DELETE declarations that are
        wrongly in a public section of their classes. To have the intended
        effect, as documented in t/l/m/compatibility.h, these must be in a
        private section.

    commit 7b3a2bd
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 12:36:46 2024 -0500

        build(bazel): always build with TF_LITE_STATIC_MEMORY

        Add TF_LITE_STATIC_MEMORY to the defines set globally for TFLM builds in
        Bazel. TFLM always builds with this set in Make, and it appears to have
        been an oversight that it wasn't set during Bazel builds. Not having it
        set in Bazel caused some unit tests to pass under Bazel that failed
        under Make.

        At the same time, add -fno-exceptions. This flag is also always set in
        Make builds. Without it, setting TF_LITE_STATIC_MEMORY breaks the build.
        TF_LITE_STATIC_MEMORY triggers TF_LITE_REMOVE_VIRTUAL_DELETE in
        t/l/m/compatibility.h, which makes operator delete private in certain
        classes. When exceptions are enabled, a placement new with those classes
        is allowed to throw an exception, and operator delete is implicitly
        called during the unwind. The build breaks because operator delete can't
        be called if it's private. Disabling exceptions eliminates the unwind
        code that calls operator delete implicitly, and thus the build succeeds.

        In any case, -fno-exceptions should have been used in Bazel builds,
        matching the flags used in Make and the no-exceptions design requirement
        of the TFLM project.

    commit 1eb4e0d
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 17 11:05:45 2024 -0500

        feat(python): don't check .sparsity in interpreter

        Remove the check for sparse tensors in the Python interpreter wrapper.
        This fixes a broken build when TF_LITE_STATIC_MEMORY is set, which
        should always be the case in TFLM. TfLiteTensor objects don't have a
        .sparsity member when TF_LITE_STATIC_MEMORY is set.

        This prepares for an upcoming commit setting TF_LITE_STATIC_MEMORY
        during Bazel builds. This hasn't caused build failures in Make builds,
        which have always set TF_LITE_STATIC_MEMORY, because Make builds don't
        build the Python interpreter wrapper.

    commit 7217095
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 16 14:03:25 2024 -0500

        fix(memory_arena_threshold): with TF_LITE_STATIC_MEMORY

        Fix the broken build due to redefinition of the threshold when
        TF_LITE_STATIC_MEMORY is set. Apparently this case isn't triggered in
        any Bazel test, only in Make.

        Simplify the threshold specification by only depending on whether
        compression is enabled and not also on whether TF_LITE_STATIC_MEMORY is
        in use.

    commit 8e4e55e
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:38:03 2024 -0500

        build(bazel): disable codegen when building --//:with_compression

        The codegen prototype code is not compatible with the changes which
        implement model compression made to the core TFLM components. For now,
        disable codegen targets when building with compression enabled.

    commit 884a234
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 15 18:31:01 2024 -0500

        build(bazel): compile in compression when --//:with_compression

        Conditionally compile in support for compressed tensors when the option
        --//:with_compression is given.

    commit a1d459b
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:28:39 2024 -0500

        build(bazel): add --//with_compression build setting

        Add a --//with_compression user-defined build setting and a
        corresponding configuration setting.

    commit 4edc564
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 12:24:53 2024 -0500

        build(bazel): fix compression-related dependencies of micro_allocator

    commit a52f97f
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 15 17:28:09 2024 -0500

        build(bazel): replace cc_* with tflm_cc_* in remaining TFLM code

        Replace cc_* targets remaining in TFLM code with tflm_cc_* targets.
        These are targets which did not formerly use the common copts. Avoid
        changing imported TFLite code, if for no other reason than to avoid
        merge conflicts during the automatic sync with upstream TFLite.

    commit a6368f4
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 11 16:08:34 2024 -0500

        build(bazel): introduce tflm_cc_* macros, refactoring away micro_copts

        Remove micro_copts() by replacing every cc_* target that used
        them with a tflm_cc_* equivalent, and setting those common copts in one
        place, inside the tflm_cc_* macro.

        This is the first of several commits introducing tflm_cc_* macros in
        place of cc_binary, cc_library, and cc_test. Motivated by the upcoming
        need to support conditional compilation, the objective is to centralize
        build configuration rather than requiring (and remembering that) each
        cc_* target in the project add the same common attributes such as
        compiler options and select()ed #defines.

        Alternatives such as setting global options on the command line or in
        .bazelrc, even if simplified with a --config option, fail to preserve
        flags and hooks for configuration in the case TFLM is used as an
        external repository by an application project. Nor is it easy in that
        case for individual targets to override an otherwise global setting.

    commit 1518422
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 23:56:49 2024 -0500

        chore: remove obsolete ci/temp_patches

        Remove ci/temp_patches, which was obsoleted in 23f608f once it
        was no longer used by the sync script. It should have been
        deleted then.

        Remove it not only to clean up dead code, but because it contains
        a reference to `micro_copts`, which is about to be refactored
        away, and we don't want to leave stray references to it in the
        tree.

    commit 18ef080
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 8 17:58:12 2024 -0500

        refactor: use metadata_saved.h instead of metadata_generated.h

        Use the generated file metadata_saved.h instead of metadata_generated.h
        for the reasons explained in t/l/m/compression/BUILD:metadata_saved.
        Delete metadata_generated.h from the source tree as it is not
        maintained.

    commit 5a02e30
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 13:46:46 2024 -0500

        test(memory_arena_threshold): adjust expected value with compression

        Fix a test failure by setting a different expected value for the
        persistent buffer allocation when compression is configured in. The
        allocation was allowed to vary by 3%; however, compression adds ~10%.
        Set the expected value to the measured value when compression is
        configured in.

    commit 01bc582
    Author: Ryan Kuester <[email protected]>
    Date:   Thu Oct 10 13:35:10 2024 -0500

        test(memory_arena_threshold): don't expect exact allocation values

        Remove the check for allocation sizes to exactly match expected values.
        This check immediately followed--and thus rendered pointless---a check
        that sizes are within a certain percentage, which seems to be the true
        intent of the test.

    commit e0aae77
    Merge: e328029 e86d97b
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 16 13:39:56 2024 -0500

        Merge branch 'main' into compress-testing

    commit e328029
    Author: Ryan Kuester <[email protected]>
    Date:   Mon Oct 7 12:52:23 2024 -0500

        build(bazel): fix dependencies in work-in-progress compression code

        In the Bazel build, add dependencies needed by the code added to
        t/l/m:micro_context for decompression. The Bazel build with or without
        compression was broken without this.

    commit e86d97b
    Author: RJ Ascani <[email protected]>
    Date:   Mon Oct 7 10:36:26 2024 -0700

        Replace rascani with suleshahid on OWNERS (tensorflow#2715)

        BUG=none

    commit b773428
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 4 09:59:10 2024 -0500

        feat(compression): add work-in-progress compression and viewer tools

    commit f6bd486
    Merge: 487c17a e3f6dc1
    Author: Ryan Kuester <[email protected]>
    Date:   Fri Oct 4 09:36:24 2024 -0500

        Merge branch 'main' into compress-prerelease

    commit e3f6dc1
    Author: David Davis <[email protected]>
    Date:   Thu Oct 3 10:45:00 2024 -0700

        Compression documentation (tensorflow#2711)

        @tensorflow/micro

        Add documentation describing some compression/decompression internals and makefile build procedures.

        bug=tensorflow#2710

    commit b3967a9
    Author: Ryan Kuester <[email protected]>
    Date:   Wed Oct 2 13:36:01 2024 -0500

        style: add .style.yapf to control yapf styling of Python code (tensorflow#2709)

        Add a .style.yapf file so yapf can be used to style Python code without
        passing the project's style via command line option. Remove the
        corresponding patch to pigweed's call to yapf, used by CI, and instead
        let it too rely on .style.yapf. Remove the developer documentation's
        instruction to use the command line option.

        BUG=description

    commit d249577
    Author: Ryan Kuester <[email protected]>
    Date:   Tue Oct 1 16:16:45 2024 -0500

        build(codegen): suppress noise in console output (tensorflow#2708)

        Add a --quiet option to the code_generator binary so that when it's used
        within the build system, it doesn't print unexpected, distracting noise
        to the console. Generally, compiler or generator commands don't print
        output unless there's an error.

        BUG=description

commit 4894265
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 17:48:05 2024 -0700

    pre-merge empty commit

commit a110e41
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 16:17:13 2024 -0700

    fix C++ bitwidth 6 & 7 decompression

commit efedcc2
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 18 10:18:50 2024 -0700

    working decompression unit test

commit 81ecf2e
Author: ddavis-2015 <[email protected]>
Date:   Thu Oct 17 18:17:06 2024 -0700

    decompression unit test improvements

commit b318421
Author: ddavis-2015 <[email protected]>
Date:   Wed Oct 16 17:34:09 2024 -0700

    add decompression unit test

commit 9bb2b63
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 13 18:34:01 2024 -0700

    cleanup

commit 77bb05d
Author: ddavis-2015 <[email protected]>
Date:   Sun Oct 13 18:29:33 2024 -0700

    align compressed tensor data as per schema

commit ad2b1c3
Author: ddavis-2015 <[email protected]>
Date:   Sat Oct 12 22:35:54 2024 -0700

    reduce HIFI5 decompression code size

commit 99c6e35
Author: ddavis-2015 <[email protected]>
Date:   Fri Oct 11 14:02:58 2024 -0700

    revert to original Cadence bit width 4 code

commit 2388549
Author: ddavis-2015 <[email protected]>
Date:   Thu Oct 10 17:50:29 2024 -0700

    refactor decompression code into reference and platform specific
    Apply some Xtensa acceleration code changes

commit b84853c
Author: ddavis-2015 <[email protected]>
Date:   Tue Oct 8 16:08:55 2024 -0700

    testing
ddavis-2015 added a commit to ddavis-2015/tflite-micro that referenced this issue Nov 25, 2024
commit 414a55a
Author: ddavis-2015 <[email protected]>
Date:   Thu Nov 21 18:15:40 2024 -0800

    last merge missed xtensa.inc file

commit 1110543
Author: ddavis-2015 <[email protected]>
Date:   Thu Nov 21 18:06:45 2024 -0800

    Squashed commit of the following:

    commit 300751d
    Author: ddavis-2015 <[email protected]>
    Date:   Wed Nov 20 12:03:16 2024 -0800

        Update to latest Cadence code.  Int8 any bitwidth on normal quant axis updated.

    commit 0a49b2a
    Author: ddavis-2015 <[email protected]>
    Date:   Wed Nov 20 10:50:30 2024 -0800

        Add input tensor CRC to Generic Benchmark application.
        Only use -O3 -LNO:simd with the xtensa decompress.cc target.

    commit 83dafce
    Author: ddavis-2015 <[email protected]>
    Date:   Mon Nov 18 17:23:58 2024 -0800

        cleanup

    commit 2f8cead
    Author: ddavis-2015 <[email protected]>
    Date:   Mon Nov 18 13:29:33 2024 -0800

        Revert FakeMicroContext changes for alternate profiler.
        Add default alternate profiler implementation to MicroContext.

    commit fddf003
    Author: ddavis-2015 <[email protected]>
    Date:   Mon Nov 18 12:29:26 2024 -0800

        Fix typo.

    commit ae6a207
    Author: ddavis-2015 <[email protected]>
    Date:   Mon Nov 18 12:29:06 2024 -0800

        Implement alternate profiler for MicroInterpreter.
        Enable use of alternate profiler by decompression code.
        Enable use of alternate profiler by Generic Benchmark application.

    commit 5e1a1c9
    Author: ddavis-2015 <[email protected]>
    Date:   Sun Nov 10 18:24:02 2024 -0800

        changes to make the memory planner debug output easier to interpret

    commit f651c88
    Author: ddavis-2015 <[email protected]>
    Date:   Sun Nov 10 04:27:29 2024 -0800

        single pending ops queue
        process pending ops recursively

    commit cfd9890
    Author: ddavis-2015 <[email protected]>
    Date:   Sun Nov 10 00:26:14 2024 -0800

        expand model_facade
        redo var handle tracking

    commit 7776cda
    Author: ddavis-2015 <[email protected]>
    Date:   Tue Nov 5 13:24:58 2024 -0800

        remove [[maybe_unused]]

    commit 40e7530
    Author: ddavis-2015 <[email protected]>
    Date:   Mon Nov 4 11:17:43 2024 -0800

        fix arena

    commit 0d889e0
    Author: ddavis-2015 <[email protected]>
    Date:   Sat Nov 2 14:18:55 2024 -0700

        Fix MicroProfiler bug with ClearEvents().
        Add pre-inference profiling to the Generic Benchmark.

commit bd04eb2
Author: ddavis-2015 <[email protected]>
Date:   Wed Nov 20 18:40:42 2024 -0800

    Pre-rebase empty commit

commit 661ad5e
Author: Ryan Kuester <[email protected]>
Date:   Thu Nov 14 11:31:23 2024 -0600

    feat(compression): update model compression tools

commit 6eac102
Author: Ryan Kuester <[email protected]>
Date:   Thu Nov 14 00:31:56 2024 -0600

    feat: add model compression draft

    Add a feature-complete draft of the model compression feature in
    a single commit. This commit isn't intended for merging into
    mainline; it exists solely for reviewers and testers to take an
    early look.

commit f91dd91
Author: Ryan Kuester <[email protected]>
Date:   Wed Nov 13 16:46:20 2024 -0600

    build(codegen): suppress noise in console output (tensorflow#2742)

    build(codegen): suppress noise in console output

    Redirect output from the code_generator binary so that when it's
    used within the build system, it doesn't print unexpected,
    distracting noise to the console. Generally, compiler or
    generator commands don't print output unless there's an error.

    This reverts "build(codegen): suppress noise in console output
    (tensorflow#2708)", commit d249577, which attempted to fix the same
    problem by adding a --quiet flag. A subsequent upgrade to the
    Tensorflow Python package caused new noise that wasn't possible
    to suppress with the flag.

    BUG=description

commit 182c8c7
Author: Adrian Lundell <[email protected]>
Date:   Tue Nov 12 23:34:09 2024 +0100

    Update CMSIS-NN Transpose conv function call (tensorflow#2760)

    Also removes OPTIMIZE_FOR_SIZE compiler option as the new implementation is more space efficient.

    BUG=CMSIS-NN update

commit d7c42b9
Author: suleshahid <[email protected]>
Date:   Tue Nov 12 12:40:15 2024 -0800

    Add SQRT to Requantize Flatbuffer. (tensorflow#2756)

    BUG=Add more support for tool.

commit 26ada36
Author: Jae H. Yoo <[email protected]>
Date:   Tue Nov 12 12:14:54 2024 -0800

    Update numpy_utils.cc to support ml_dtypes.bfloat16 (tensorflow#2758)

    This commit adds NPY_USERDEF for ml_dtypes.bfloat16 only. Other types are not supported yet.

    BUG=tensorflow#2759
    BUG=2759

commit 79c3fde
Author: Ryan Kuester <[email protected]>
Date:   Tue Nov 12 13:40:59 2024 -0600

    ci(bazel): improve logging of bazel CI tests (tensorflow#2749)

    Improve the logging of Bazel commands run in CI by setting several
    options that turn off, e.g., progress messages intended for interactive
    shells, and turn on, e.g., more verbose output when something fails.

    BUG=tensorflow#2742

commit 9245002
Author: Ryan OShea <[email protected]>
Date:   Wed Nov 6 20:18:28 2024 +0100

    Fix issue with transposing shape in CMSIS-NN batch matmul (tensorflow#2741)

    BUG=tensorflow#2740

commit 4bb78c7
Author: Ryan Kuester <[email protected]>
Date:   Tue Nov 5 19:11:45 2024 -0600

    fix(create_tflm_tree): remove recent tests from exported tree (tensorflow#2751)

    Remove the recently added span_test.cc and static_vector_test.cc from
    the files exported by the create_tflm_tree.py project generation process
    by adding them to the list of tests in the Makefile. Unit tests are not
    meant to be included in exported trees; they may include files that are
    not exported.

    This change also ensures that these tests are included when `make test`
    is run.

    BUG=fixes tensorflow#2718

commit 45cd79b
Author: Måns Nilsson <[email protected]>
Date:   Tue Nov 5 23:13:20 2024 +0100

    Replace CoreDebug with DCB (tensorflow#2746)

    BUG=The CMSIS CoreDebug macro is deprecated.

commit 694d250
Author: Ryan Kuester <[email protected]>
Date:   Tue Nov 5 15:48:52 2024 -0600

    chore: remove obsolete ci/temp_patches (tensorflow#2744)

    chore: remove obsolete ci/temp_patches

    Remove ci/temp_patches, which was obsoleted in 23f608f once it
    was no longer used by the sync script. It should have been
    deleted then.

    Remove it not only to clean up dead code, but because it contains
    a reference to `micro_copts`, which is about to be refactored
    away, and we don't want to leave stray references to it in the
    tree.

    BUG=tensorflow#2636

commit 8eb6b23
Author: Ryan Kuester <[email protected]>
Date:   Fri Nov 1 17:10:05 2024 -0500

    build(bazel): add integrity check to nnlib_hifi4 download (tensorflow#2743)

    build(bazel): add integrity check to nnlib_hifi4 download

    Add an integrity check to the http_archive() download of nnlib_hifi4 in
    order to make the build more hermetic, reduce the security risk that a
    remote file changes, and silence the noisy warning on the console during
    the build:

        DEBUG: Rule 'nnlib_hifi4' indicated that a canonical reproducible
        form can be obtained by modifying arguments integrity[....]

    BUG=description

commit 5a46ab0
Author: Måns Nilsson <[email protected]>
Date:   Fri Nov 1 20:57:00 2024 +0100

    Add kernels optimized for size flag to FC and SVDF (tensorflow#2734)

    The kernels optimized for size flag provides an alternative implementation where size is prioritized over latency.

    For size option (speed option is default) it means the CMSIS-NN kernels are calculating kernel sums during inference.

    BUG=no bug but this will let users prioritize speed vs size even more

commit 389e775
Author: suleshahid <[email protected]>
Date:   Tue Oct 29 13:57:29 2024 -0700

    Fix upstream sync (tensorflow#2728)

    * .

    * nl add

    * Sync from upstream TF.

    * fix include

    ---------

    Co-authored-by: TFLM-bot <[email protected]>

commit e440f0a
Author: Måns Nilsson <[email protected]>
Date:   Mon Oct 28 20:16:43 2024 +0100

    Update CMSIS third party download (tensorflow#2716)

    CMSIS is updated from CMSIS_5 to CMSIS_6.

    BUG=It is recommended to upgrade from CMSIS_5 to CMSIS_6

commit 1b975d9
Author: suleshahid <[email protected]>
Date:   Mon Oct 28 11:27:23 2024 -0700

    Update deprecated mergify rules (tensorflow#2732)

    * .

    * nl add

    * update mergify

commit 78e5467
Author: Ryan Kuester <[email protected]>
Date:   Fri Oct 25 18:27:21 2024 -0500

    fix(python): add compatibility with NumPy 2 (tensorflow#2733)

    Upgrade the pinned packages used in the Bazel build environment to make
    the Python extension module compatible with NumPy 2 in addition to NumPy
    1. Modules built against NumPy 1 are not compatible with runtime
    environments that use NumPy 2, but modules built against NumPy 2 should
    be compatible with both.

    The python_requirements.txt defining the Bazel build environment is was
    upgraded via the command:

        bazel run //third_party:python_requirements.update -- --upgrade

    See third_party/python_requirements.in for details.

    This change upgraded a number of other packages as well, notably
    Tensorflow, from 2.17 to 2.18. In fact, Tensorflow 2.18 is also required
    for compatibility with NumPy 2.

    Also update the path to the header files within the NumPy wheel, used by
    the :numpy_cc_deps target. Our method of including header files shipped
    in Python packages is sensitive to the internal details of those
    packages, and NumPy moved their headers during this major version
    change.

    This fixes tensorflow#2731, in which //python/tflite_micro:whl_test began failing.
    :whl_test installs the newly built tflite_micro package, which packages
    our Python extension module, and its dependencies into a clean virtual
    environment and performs tests. The tflite_micro package has unversioned
    dependencies on the tensorflow and numpy packages. Within the last 24
    hours, tensorflow in PyPI was upgraded from 2.17 to 2.18. The 2.18
    release upgraded tensorflow's versioned dependency on numpy from 1 to 2,
    forcing the environment created by :whl_test to use NumPy 2 instead of
    NumPy 1; thereby exposing the incompatibility of the extension module
    that was built against NumPy 1, and causing :whl_test to fail.

    BUG=tensorflow#2731

commit e86d97b
Author: RJ Ascani <[email protected]>
Date:   Mon Oct 7 10:36:26 2024 -0700

    Replace rascani with suleshahid on OWNERS (tensorflow#2715)

    BUG=none

commit e3f6dc1
Author: David Davis <[email protected]>
Date:   Thu Oct 3 10:45:00 2024 -0700

    Compression documentation (tensorflow#2711)

    @tensorflow/micro

    Add documentation describing some compression/decompression internals and makefile build procedures.

    bug=tensorflow#2710

commit b3967a9
Author: Ryan Kuester <[email protected]>
Date:   Wed Oct 2 13:36:01 2024 -0500

    style: add .style.yapf to control yapf styling of Python code (tensorflow#2709)

    Add a .style.yapf file so yapf can be used to style Python code without
    passing the project's style via command line option. Remove the
    corresponding patch to pigweed's call to yapf, used by CI, and instead
    let it too rely on .style.yapf. Remove the developer documentation's
    instruction to use the command line option.

    BUG=description

commit d249577
Author: Ryan Kuester <[email protected]>
Date:   Tue Oct 1 16:16:45 2024 -0500

    build(codegen): suppress noise in console output (tensorflow#2708)

    Add a --quiet option to the code_generator binary so that when it's used
    within the build system, it doesn't print unexpected, distracting noise
    to the console. Generally, compiler or generator commands don't print
    output unless there's an error.

    BUG=description
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

No branches or pull requests

1 participant