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

Detect GPU on startup for default multi-pass indexing value #2242

Merged
merged 7 commits into from
Aug 31, 2024

Conversation

pablonyx
Copy link
Contributor

Description

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Accepted Risk

[Any know risks or failure modes to point out to reviewers]

Related Issue(s)

[If applicable, link to the issue(s) this PR addresses]

Checklist:

  • All of the automated tests pass
  • All PR comments are addressed and marked resolved
  • If there are migrations, they have been rebased to latest main
  • If there are new dependencies, they are added to the requirements
  • If there are new environment variables, they are added to all of the deployment methods
  • If there are new APIs that don't require auth, they are added to PUBLIC_ENDPOINT_SPECS
  • Docker images build and basic functionalities work
  • Author has done a final read through of the PR right before merge

Copy link

vercel bot commented Aug 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2024 0:20am

backend/danswer/utils/gpu_utils.py Outdated Show resolved Hide resolved
backend/danswer/utils/gpu_utils.py Outdated Show resolved Hide resolved
@@ -341,6 +370,9 @@ async def lifespan(app: FastAPI) -> AsyncGenerator:

translate_saved_search_settings(db_session)

# update multipass indexing setting based on GPU availability
update_default_multipass_indexing(db_session)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would place this later (after the embedding warm up setup) because that step has backoff and retries. Otherwise this call to check GPU could run before the model server is actually up

Copy link
Contributor

Choose a reason for hiding this comment

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

note that the call later on checks for the inference server, not indexing

backend/danswer/main.py Outdated Show resolved Hide resolved
backend/danswer/main.py Outdated Show resolved Hide resolved
backend/danswer/main.py Show resolved Hide resolved
else:
model_server_url = f"{MODEL_SERVER_HOST}:{MODEL_SERVER_PORT}"

if "http" not in model_server_url:
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to change but if this is now repeated functionality, we can pull it out into a function

@yuhongsun96 yuhongsun96 merged commit 76db4b7 into main Aug 31, 2024
6 of 7 checks passed
@yuhongsun96 yuhongsun96 deleted the model_startup_gpu branch August 31, 2024 00:38
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.

2 participants