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

fix redis cluster api: MaccumCommand #474

Merged
merged 5 commits into from
Jan 7, 2025
Merged

Conversation

BobLiu20
Copy link
Contributor

@BobLiu20 BobLiu20 commented Oct 22, 2024

Description

Brief Description of the PR:

Fixes # (issue)

Type of change

  • [✅] Bug fix
  • New Tutorial
  • Updated or additional documentation
  • Additional Testing
  • New Feature

Checklist:

  • I've properly formatted my code according to the guidelines
    • By running yapf
    • By running clang-format
  • This PR addresses an already submitted issue for TensorFlow Recommenders-Addons
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

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.

MoFHeka
MoFHeka previously approved these changes Nov 13, 2024
Copy link
Collaborator

@MoFHeka MoFHeka left a comment

Choose a reason for hiding this comment

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

So it's a memory length bug of TF bool type tensor?
LGTM

@rhdong
Copy link
Member

rhdong commented Nov 17, 2024

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

@BobLiu20
Copy link
Contributor Author

BobLiu20 commented Jan 3, 2025

@rhdong Hi, I'm very sorry for the late reply. I have fixed the formatting issue. Please check again thanks.

Copy link
Collaborator

@MoFHeka MoFHeka left a comment

Choose a reason for hiding this comment

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

LGTM

@BobLiu20
Copy link
Contributor Author

BobLiu20 commented Jan 3, 2025

Hi @MoFHeka , Please check again thanks

@rhdong rhdong merged commit 771996d into tensorflow:master Jan 7, 2025
36 checks passed
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

Successfully merging this pull request may close these issues.

3 participants