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

add faiss debug option #2113

Merged

Conversation

datelier
Copy link
Contributor

@datelier datelier commented Jul 6, 2023

Description:

SSIA

Related Issue:

Versions:

  • Go Version: 1.20.5
  • Docker Version: 20.10.8
  • Kubernetes Version: v1.27.3

Checklist:

Special notes for your reviewer:

@datelier datelier requested review from a team, kmrmt and kevindiu and removed request for a team July 6, 2023 06:01
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 6, 2023

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - replace the PR body by changelog details
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase main
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

Copy link
Contributor

@kmrmt kmrmt left a comment

Choose a reason for hiding this comment

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

LGTM and I have some C++ techniques.

Comment on lines 34 to 38
#if DEBUG
printf(__FUNCTION__);
printf("\n");
fflush(stdout);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#if DEBUG
printf(__FUNCTION__);
printf("\n");
fflush(stdout);
#endif
#if DEBUG
printf("%s\n", __FUNCTION__);
fflush(stdout);
#endif

You can use some macros such as __PRETTY_FUNCTION__ and __LINE__ for detail debug message.

FYI, there is one of some debugging techniques like below.

#ifdef DEBUG
#define DEBUG_MESSAGE(x) do { std::cout << "[" << __FUNCTION__ << ":" << __LINE__ << "]" << x << std::endl; } while(0)
#else
#define DEBUG_MESSAGE(x)
#endif

Copy link
Contributor

@ykadowak ykadowak left a comment

Choose a reason for hiding this comment

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

Also it's better to do something like this once and use the typed variable for the rest.

#if defined(DEBUG)
constexpr bool isDebug = true;
#else
constexpr bool isDebug = false;
#endif

internal/core/algorithm/faiss/Capi.cpp Outdated Show resolved Hide resolved
Makefile.d/build.mk Show resolved Hide resolved
internal/core/algorithm/faiss/Capi.h Show resolved Hide resolved
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 10, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d734257
Status: ✅  Deploy successful!
Preview URL: https://b5e763a7.vald.pages.dev
Branch Preview URL: https://feature-agent-faiss.vald.pages.dev

View logs

@datelier datelier merged commit 8e6e33f into feature/agent/new-agents-helm-template-base Jul 11, 2023
@datelier datelier deleted the feature/agent/faiss branch July 11, 2023 04:35
kpango added a commit that referenced this pull request Jul 15, 2023
add faiss debug option
modify to constexpr bool
Merge pull request #2113 from vdaas/feature/agent/faiss

Signed-off-by: kpango <[email protected]>
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.

5 participants