-
Notifications
You must be signed in to change notification settings - Fork 73
feat: expose configuration for GPU acceleration and index worker threads in context server #960
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
Conversation
…ads in context server
updatedConfig.projectContext?.enableLocalIndexing | ||
? await localProjectContextController.init() | ||
? await localProjectContextController.init({ | ||
enableGpuAcceleration: updatedConfig?.projectContext?.enableGpuAcceleration, | ||
indexWorkerThreads: updatedConfig?.projectContext?.indexWorkerThreads, | ||
}) | ||
: await localProjectContextController.dispose() |
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.
At this point should this just be an if
statement? ;)
updatedConfig.projectContext?.enableLocalIndexing | ||
? await localProjectContextController.init() | ||
? await localProjectContextController.init({ | ||
enableGpuAcceleration: updatedConfig?.projectContext?.enableGpuAcceleration, | ||
indexWorkerThreads: updatedConfig?.projectContext?.indexWorkerThreads, | ||
}) | ||
: await localProjectContextController.dispose() |
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.
Can init
and dispose
be done multiple times per session? What happens if (for whatever reason) 2 init
s or 2 dispose
s happen in a row?
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.
Reading along, it seems like 2x dispose
is pretty safe, but 2x init
would result in orphaned resources.
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.
Made init no-op if already initialized.
@@ -112,6 +114,8 @@ export async function getAmazonQRelatedWorkspaceConfigs( | |||
}, | |||
projectContext: { | |||
enableLocalIndexing: newQConfig.projectContext?.enableLocalIndexing === true, | |||
enableGpuAcceleration: newQConfig.projectContext?.enableGpuAcceleration === true, | |||
indexWorkerThreads: newQConfig.projectContext?.indexWorkerThreads ?? -1, |
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.
Does -1
have a special meaning? Or would 0
threads mean the same thing?
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.
It would be the same - I just considered -1
to be more of an effective no-op/disabled state.
bb3ce8a
to
911e441
Compare
911e441
to
12ae8c7
Compare
Problem
Clients may want to configure the optional GPU acceleration and index worker thread parameters of the local indexing library. VSCode and Jetbrains support these options in their user facing preference panes.
Solution
Add these options to the LSP server's supported set of configurables. By default, GPU acceleration is off and index worker threads are not explicitly set.
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.