Repository navigation
Conversation
Every ComputeHandle on a device used the device's single in-order command queue, so with numNNServerThreadsPerModel > 1 the server threads' batches and blocking reads ran one after another and the GPU sat partly idle. Create a queue per handle on the shared context and release it in the destructor. Each handle already owns its weights, buffers and kernels, so no other synchronization is needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every OpenCL
ComputeHandleInternalused the device's single in-order command queue (commandQueue = device->commandQueue), so withnumNNServerThreadsPerModel > 1the server threads' batches and blocking reads ran one after another. This gives each handle its own queue on the shared context and releases it in the destructor. Handles already own their weights, buffers and kernels, so nothing else needs locking.katago testgpuerror -quickoutput is identical before and after (8 server threads, b10c128 and b20c256x2).RX 6800 XT, ROCm OpenCL, analysis engine on 17 games,
maxVisits100, 256 analysis threads with 1 search thread each. Positions per second:GPU busy goes from about 60% (b10) and 86% (b20) to 99%. Before the change, 8 server threads was slower than 4. I've only tested on AMD.