-
Notifications
You must be signed in to change notification settings - Fork 187
Add UCCL backend integration for NIXL #895
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
Open
praveingk
wants to merge
17
commits into
ai-dynamo:main
Choose a base branch
from
praveingk:uccl-backend-pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,496
−1
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
86f6d6b
Add support uccl-backend for NIXL
praveingk cd2bbea
Cleanup and minor changes to readme
praveingk 7e211cb
Further cleanup including moving startListener to private
praveingk b5e3c5b
Revert changes to plugin manager test
praveingk 9648e6e
Fix formatting
praveingk 489ecd0
Add more details to readme
praveingk 25da211
Remove trailing whitespaces in readme
praveingk baa7c85
Remove trailing whitespaces in test
praveingk db047c0
Remove num_cpus from agent config
praveingk 524e078
Fix typo in uccl backend
praveingk be90f7f
Merge branch 'main' into uccl-backend-pr
praveingk dde50c5
Add UCCL to test_plugin
praveingk 7eb674c
Modify env vars descriptions and road map to README
praveingk a972a7c
Merge branch 'main' into uccl-backend-pr
praveingk 96866cd
Remove custom parameter device_idx
praveingk 06c74a1
Merge branch 'uccl-backend-pr' of github.com:praveingk/nixl-uccl into…
praveingk c6b0880
Merge branch 'main' into uccl-backend-pr
brminich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| ## UCCL Backend Plugin [Preview] | ||
|
|
||
| [UCCL](https://github.com/uccl-project/uccl) is an efficient communication library to perform GPU memory transfers, with a focus on flexibility (evolving ML workloads) and portability (heteregenous GPUs). UCCL provides a software transport stack which runs on the CPUs and are easily extensible to support different techniques like congestion control, multipathing, efficient loss recovery, etc. | ||
| UCCL supports collectives, p2p communication and gpu-driven communication for expert parallelism. | ||
|
|
||
| ## Capabilities | ||
|
|
||
| Currently, the UCCL backend supports internode communication over RDMA. Intranode communication will be added soon. | ||
|
|
||
| ## Installation Guide | ||
|
|
||
| 1. Install UCCL's p2p engine manually. You can refer to the [installation guide here](https://https://github.com/uccl-project/uccl). | ||
|
|
||
| ```cpp | ||
| git clone https://github.com/uccl-project/uccl.git | ||
| cd uccl/p2p | ||
| make -j | ||
| sudo make install | ||
| ``` | ||
|
|
||
| 2. Build NIXL using regular method as in [README](https://github.com/ai-dynamo/nixl/blob/main/README.md) ensuring `disable_uccl_backend` is set to `false`. | ||
|
|
||
| ## Usage Guide | ||
|
|
||
| Example Usage to create a NIXL agent with uccl engine: | ||
|
|
||
| ```python | ||
| config = nixl_agent_config(backends=["UCCL"]) | ||
| agent = nixl_agent("agent-name", config) | ||
| ``` | ||
| UCCL engine would auto discover the right NIC to be used for the GPU based on the PCIe distance during memory registration based on the data locality. | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| Refer to [README](https://github.com/uccl-project/uccl/tree/main/collective/rdma#environment-variables-in-uccl) for the complete list of environment variables that can be set to customize UCCL. | ||
|
|
||
| **Important**: For `NIXL_READ` operations set `UCCL_RCMODE=1`. By default, UCCL uses RDMA UC (Unreliable Connection). However, `READ` operations need to operate on RDMA RC (Reliable Connection). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that, should we reject read operations if the RCMODE is not set correctly? |
||
|
|
||
| ### Usage References | ||
|
|
||
| 1) [NIXL Benchmark](https://github.com/uccl-project/uccl/blob/main/p2p/benchmarks/benchmark_nixl.py) in UCCL: Refer to this [README](https://github.com/uccl-project/uccl/tree/main/p2p) on how to run the script. | ||
|
|
||
| 2) [NIXL connector](https://github.com/praveingk/vllm/commit/fa67cd7edff076fee4914cc316a9833c2311a65d) in vLLM. vLLM's NIXL connector uses `NIXL_READ` operations, hence set env `UCCL_RCMODE` to 1. | ||
|
|
||
| ### Road Map | ||
|
|
||
| - [ ] Add Intra-node communication support | ||
|
|
||
| - [ ] Add Progress Thread support | ||
|
|
||
| - [ ] Add asynchronous posting of reads over multiple workers to mitigate latency increase upon fragmentation | ||
|
|
||
| - [ ] Add support for other transport (TCP, TCP-X, etc.) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| cpp = meson.get_compiler('cpp') | ||
| uccl_lib = cpp.find_library('uccl_engine') | ||
|
|
||
| compile_flags = [] | ||
|
|
||
|
|
||
| if 'UCCL' in static_plugins | ||
| uccl_backend_lib = static_library('UCCL', | ||
| 'uccl_backend.cpp', 'uccl_backend.h', 'uccl_plugin.cpp', | ||
| dependencies: [nixl_infra, serdes_interface, cuda_dep, uccl_lib, nixl_common_dep], | ||
| include_directories: nixl_inc_dirs, | ||
| install: false, | ||
| cpp_args : compile_flags, | ||
| name_prefix: 'libplugin_') # Custom prefix for plugin libraries | ||
| else | ||
| uccl_backend_lib = shared_library('UCCL', | ||
| 'uccl_backend.cpp', 'uccl_backend.h', 'uccl_plugin.cpp', | ||
| dependencies: [nixl_infra, serdes_interface, cuda_dep, uccl_lib, nixl_common_dep], | ||
| include_directories: [nixl_inc_dirs, utils_inc_dirs], | ||
| install: true, | ||
| cpp_args : compile_flags + ['-fPIC'], | ||
| name_prefix: 'libplugin_', # Custom prefix for plugin libraries | ||
| install_dir: plugin_install_dir) | ||
|
|
||
| if get_option('buildtype') == 'debug' | ||
| run_command('sh', '-c', | ||
| 'echo "UCCL=' + uccl_backend_lib.full_path() + '" >> ' + plugin_build_dir + '/pluginlist', | ||
| check: true | ||
| ) | ||
| endif | ||
| endif | ||
|
|
||
| uccl_backend_interface = declare_dependency(link_with: uccl_backend_lib) |
Oops, something went wrong.
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.
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.
Shoud this be
UCCLcapitalized?