Repository navigation
Implement new synchronization read-write locking mode - #333
Merged
Merged
Conversation
|
👋 Hi w1ldptr! Thank you for contributing to ai-dynamo/nixl. Your PR reviewers will review your contribution then trigger the CI to test your changes. 🚀 |
artpol84
approved these changes
May 19, 2025
etoledano
approved these changes
May 19, 2025
w1ldptr
force-pushed
the
rw2
branch
2 times, most recently
from
May 20, 2025 08:48
aaf5586 to
0575e28
Compare
brminich
approved these changes
May 20, 2025
rakhmets
reviewed
May 20, 2025
The test wasn't updated during previous nixlAgentConfig constructor API change and doesn't compile. Update the API usage. Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Since this change also makes genNotify execute in parallel with several other data path functions also cover it with thread sanitizer test. Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Abseil mutex can be used as a regular mutex or as a read-write lock which is convenient for run-time selection of synchronization model. Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Implement new RW mode that takes advantage of Abseil mutex functionality that allows using it as a read-write lock: - Refactor nixlLock class to use callbacks internally in order to simplify the structure of its methods by doing all necessary processing according to user-specified mode in the class constructor. All API methods just call mode-specific callbacks set by the constructor. - Take the lock in read mode for a data-path subset of NIXL Agent API (reateXferReq, postXferReq, getXferStatus, releaseXferReq, genNotif). - Continue using the lock in regular write mode for all other API methods. Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Current UCX context configuration doesn't properly take advantage of synchronization model and progress thread options. Instead of UCX backend setting the most restrictive option possible, pass progress thread flag, number of UCX workers and NIXL sync mode. Set the following UCX context config toggles based on those parameters: - Set UCX config 'mt_workers_shared' to 1 only when multiple workers have been requested by the user. - When progress thread is disabled and sync mode is strict or none chose NIXL_UCX_MT_SINGLE multi-threading type which translates to UCS_THREAD_MODE_SERIALIZED UCX worker thread mode. Otherwise, chose NIXL_UCX_MT_WORKER type which translates to UCS_THREAD_MODE_MULTI UCX worker mode. Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
rakhmets
approved these changes
May 21, 2025
This branch was previously 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.
First, preparatory commits fixing/extending multi-threading tests.
Then, the new sync mode implementation that changes existing NIXL agent mutex from std to Abseil implementation which supports both regular exclusive locking and read-write modes. Add new 'RW' sync mode and take the lock in the read mode in a subset of NIXL data-path APIs (reateXferReq, postXferReq, getXferStatus, releaseXferReq, genNotif).
On top of that perform small UCX Context class refactoring to initialize UCX context and workers with the most appropriate setting according to the configuration requested by the user (sync mode, progress thread on/off, number of workers).