Skip to content

Conversation

ddavis-2015
Copy link
Member

@tensorflow/micro

Add initial support for DECODE operator.
Add reference implementation.
Add LUT decompression support.
Update op resolvers.
Update Makefiles and Bazel BUILD files.
Add kernel unit test.

bug=fixes #3131

@tensorflow/micro

Add initial support for DECODE operator.
Add reference implementation.
Add LUT decompression support.
Update op resolvers.
Update Makefiles and Bazel BUILD files.
Add kernel unit test.

bug=fixes tensorflow#3131
@ddavis-2015 ddavis-2015 requested a review from a team as a code owner July 8, 2025 18:59
@ddavis-2015 ddavis-2015 self-assigned this Jul 8, 2025
@ddavis-2015 ddavis-2015 requested a review from veblush September 9, 2025 17:47
Copy link
Collaborator

@veblush veblush left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This looks great, I've just left a few minor suggestions.


namespace tflite {

struct DecodeState {
Copy link
Collaborator

Choose a reason for hiding this comment

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


namespace tflite {

struct DecodeStateLUT : public DecodeState {
Copy link
Collaborator

Choose a reason for hiding this comment

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

#include "tensorflow/lite/micro/micro_profiler_interface.h"

namespace tflite {

Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about converting DecodeState into an interface called IDecodeAlgorithm? This would clarify its role, and we could then reorganize the helper functions into a separate container class.

@@ -0,0 +1,344 @@
/* Copyright 2025 The TensorFlow Authors. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be clearer if we split this into separate tests, with each one focused on a specific algorithm?

};

// Align the tensor data the same as a Buffer in the TfLite schema
alignas(16) const uint8_t kEncodedLUT[] = {0x1B, 0xE4};
Copy link
Collaborator

Choose a reason for hiding this comment

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

It'd be useful to have a comment as to how this is constructed.

count -= 1;
}

// process elements in current channel in groups of 16
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity, why 16 instead of 8?

@@ -0,0 +1,344 @@
/* Copyright 2025 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
Copy link
Collaborator

Choose a reason for hiding this comment

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

LUT has many combinations to cover. Then, do you have a plan to expand the coverage a bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for DECODE operator

3 participants