-
Notifications
You must be signed in to change notification settings - Fork 141
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
[DRAFT][onert-micro] Introduce Huffman Transcoder #12744
base: master
Are you sure you want to change the base?
Conversation
Output for this example:
As we can see - using this coding of quantized weights we can significantly compress weights tensor (under the assumption that it contains many identical values) |
e5ad7a3
to
26695af
Compare
This commit introduces Huffman Transcoder for lossless weight compression. ONE-DCO-1.0-Signed-off-by: Vyacheslav Bazhenov <slavikmipt@gmail.com>
26695af
to
bc674b5
Compare
// std::cout << "Huffman Codes are :\n"; | ||
// for (auto pair : huffmanCode) { | ||
// std::cout << static_cast<int>(pair.first) << " " << pair.second << '\n'; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think need to be remove, right?)
// TODO: replace string with bitset or bool vector | ||
// print encoded string | ||
std::string str = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better rewrite it to bool or bitset in this draft? Since a string can take up a lot of extra memory, and then check memory after that?
This commit introduces Huffman Transcoder for lossless weight compression.
ONE-DCO-1.0-Signed-off-by: Vyacheslav Bazhenov slavikmipt@gmail.com