[Opt] cache thread-local CUDA stream for lock acquisition kernels#248
Open
rhdong wants to merge 1 commit intoNVIDIA-Merlin:masterfrom
Open
[Opt] cache thread-local CUDA stream for lock acquisition kernels#248rhdong wants to merge 1 commit intoNVIDIA-Merlin:masterfrom
rhdong wants to merge 1 commit intoNVIDIA-Merlin:masterfrom
Conversation
Replace per-call cudaStreamCreate/Destroy in lock_read(), lock_update(), and lock_update_read() with a thread_local cached stream. Eliminates CUDA driver contention when multiple threads acquire locks concurrently, which caused triple-group mode to underperform R/W lock in mixed workloads (0.93x) despite allowing concurrent updaters.
Documentation previewhttps://nvidia-merlin.github.io/HierarchicalKV/review/pr-248 |
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.
Replace per-call cudaStreamCreate/Destroy in lock_read(), lock_update(), and lock_update_read() with a thread_local cached stream. Eliminates CUDA driver contention when multiple threads acquire locks concurrently, which caused triple-group mode to underperform R/W lock in mixed workloads (0.93x) despite allowing concurrent updaters.
CI tests passed on the local machine.
Triple-Group vs R/W Lock Concurrency Benchmark
Config: dim=16, capacity=128M, HBM=16GB, λ=0.75, batch=64K, 200 batches/thread, H100 NVL
With Stream Cache Optimization
Before vs After Stream Cache