tensorflow / recommenders-addons

Additional utils and helpers to extend TensorFlow when build recommendation systems, contributed and maintained by SIG Recommenders.
Apache License 2.0
596 stars 136 forks source link

fix redis cluster api: MaccumCommand #474

Open BobLiu20 opened 1 month ago

BobLiu20 commented 1 month ago

Description

Brief Description of the PR:

Fixes # (issue)

Type of change

Checklist:

How Has This Been Tested?

If you're adding a bugfix or new feature please describe the tests that you ran to verify your changes: *

Redis cluster mode: all data need to split by slot. Already test in my redis cluster.

rhdong commented 1 week ago

Hi @BobLiu20 , thank you for your contribution! There's a c++ format issue need to be processed, you could refer to the code style guide to format them, any problem please feel free to connect us, many thanks! No so sure if you could see the error, just pasted here for your reference.

#16 [clang-format 7/8] RUN python run-clang-format.py                -r                --cli-args=--style=google                --clang-format-executable ./clang-format/clang-format9                /recommenders-addons/tensorflow_recommenders_addons
#16 0.989 --- /recommenders-addons/tensorflow_recommenders_addons/dynamic_embedding/core/kernels/redis_impl/redis_cluster_connection_pool.hpp   (original)
#16 0.989 +++ /recommenders-addons/tensorflow_recommenders_addons/dynamic_embedding/core/kernels/redis_impl/redis_cluster_connection_pool.hpp   (reformatted)
#16 0.989 @@ -1305,12 +1305,14 @@
#16 0.989      std::vector<std::unique_ptr<std::vector<char>>> exists_chars(storage_slice);
#16 0.989      for (unsigned i = 0; i < storage_slice; ++i) {
#16 0.989        if (!exists_split[i].empty()) {
#16 0.989 -        exists_chars[i] = std::make_unique<std::vector<char>>(exists_split[i].size());
#16 0.989 -        std::transform(exists_split[i].begin(), exists_split[i].end(), exists_chars[i]->begin(), [](bool b) {
#16 0.989 -            return static_cast<char>(b);
#16 0.989 -        });
#16 0.989 -
#16 0.989 -        thread_context->HandlePushBack(i, exists_chars[i]->data(), exists_chars[i]->size() * sizeof(char));
#16 0.989 +        exists_chars[i] =
#16 0.989 +            std::make_unique<std::vector<char>>(exists_split[i].size());
#16 0.989 +        std::transform(exists_split[i].begin(), exists_split[i].end(),
#16 0.989 +                       exists_chars[i]->begin(),
#16 0.989 +                       [](bool b) { return static_cast<char>(b); });
#16 0.989 +
#16 0.989 +        thread_context->HandlePushBack(i, exists_chars[i]->data(),
#16 0.989 +                                       exists_chars[i]->size() * sizeof(char));
#16 0.989        }
#16 0.989      }
#16 0.989  
#16 ERROR: process "/bin/sh -c python run-clang-format.py                -r                --cli-args=--style=google                --clang-format-executable ./clang-format/clang-format9                /recommenders-addons/tensorflow_recommenders_addons" did not complete successfully: exit code: 1
------
 > [clang-format 7/8] RUN python run-clang-format.py                -r                --cli-args=--style=google                --clang-format-executable ./clang-format/clang-format9                /recommenders-addons/tensorflow_recommenders_addons:
0.989 +            std::make_unique<std::vector<char>>(exists_split[i].size());
0.989 +        std::transform(exists_split[i].begin(), exists_split[i].end(),
0.989 +                       exists_chars[i]->begin(),
0.989 +                       [](bool b) { return static_cast<char>(b); });
0.989 +
0.989 +        thread_context->HandlePushBack(i, exists_chars[i]->data(),
0.989 +                                       exists_chars[i]->size() * sizeof(char));
0.989        }
0.989      }
0.989  
------
ERROR: failed t