├── src ├── api │ ├── python │ │ ├── py.typed │ │ ├── meson.build │ │ └── __init__.py │ ├── cpp │ │ └── meson.build │ └── meson.build ├── arch │ └── .gitignore ├── bindings │ ├── python │ │ ├── .gitignore │ │ ├── nixl-meta │ │ │ ├── README.md │ │ │ ├── nixl │ │ │ │ ├── meson.build │ │ │ │ └── __init__.py │ │ │ ├── pyproject.toml.in │ │ │ └── meson.build │ │ ├── meson.build │ │ └── nixl_utils.cpp │ ├── rust │ │ ├── .gitignore │ │ ├── rust-toolchain.toml │ │ ├── src │ │ │ ├── utils.rs │ │ │ └── descriptors │ │ │ │ ├── xfer_dlist_handle.rs │ │ │ │ └── sync_manager.rs │ │ └── Cargo.toml │ └── meson.build ├── plugins │ ├── telemetry │ │ ├── meson.build │ │ └── prometheus │ │ │ └── prometheus_plugin.cpp │ ├── hf3fs │ │ ├── hf3fs_log.h │ │ ├── hf3fs_plugin.cpp │ │ └── README.md │ ├── posix │ │ ├── queue_factory_impl.h │ │ ├── posix_plugin.cpp │ │ └── posix_queue.h │ ├── cuda_gds │ │ └── gds_plugin.cpp │ ├── obj │ │ ├── obj_plugin.cpp │ │ └── obj_executor.h │ ├── gds_mt │ │ ├── gds_mt_plugin.cpp │ │ └── gds_mt_utils.h │ ├── libfabric │ │ └── libfabric_plugin.cpp │ ├── uccl │ │ └── uccl_plugin.cpp │ ├── mooncake │ │ └── mooncake_plugin.cpp │ └── ucx │ │ └── ucx_plugin.cpp ├── utils │ ├── meson.build │ ├── common │ │ ├── util.h │ │ ├── operators.h │ │ └── nixl_time.h │ ├── serdes │ │ ├── meson.build │ │ └── serdes.h │ ├── file │ │ ├── meson.build │ │ └── file_utils.h │ ├── README.md │ ├── stream │ │ └── meson.build │ └── ucx │ │ ├── rkey.h │ │ ├── rkey.cpp │ │ ├── gpu_xfer_req_h.h │ │ ├── meson.build │ │ └── config.h ├── core │ └── telemetry │ │ ├── buffer_plugin.cpp │ │ ├── buffer_exporter.cpp │ │ └── buffer_exporter.h ├── infra │ ├── meson.build │ ├── test_utils.cpp │ └── test_utils.h └── meson.build ├── .github ├── copy-pr-bot.yaml ├── pull_request_template.md └── workflows │ ├── python-checks.yml │ ├── pre-commit.yml │ ├── copyright-checks.yml │ ├── clang-format.yml │ ├── pr-size-check.yml │ ├── build_validation.yml │ └── mirror_repo.sh ├── test ├── python │ ├── .gitignore │ ├── conftest.py │ └── desc_perf.py ├── unit │ ├── meson.build │ ├── utils │ │ ├── meson.build │ │ ├── stream │ │ │ ├── meson.build │ │ │ └── metadata_streamer.cpp │ │ ├── serdes │ │ │ ├── meson.build │ │ │ └── serdes_test.cpp │ │ ├── common │ │ │ ├── meson.build │ │ │ └── p2p_socket_test.cpp │ │ └── libfabric │ │ │ └── meson.build │ └── plugins │ │ ├── cuda_gds │ │ └── meson.build │ │ ├── gds_mt │ │ └── meson.build │ │ ├── gusli │ │ └── meson.build │ │ ├── posix │ │ └── meson.build │ │ ├── hf3fs │ │ └── meson.build │ │ ├── mooncake │ │ └── meson.build │ │ ├── gpunetio │ │ └── meson.build │ │ └── ucx │ │ └── meson.build ├── meson.build ├── gtest │ ├── device_api │ │ └── meson.build │ ├── unit │ │ ├── agent │ │ │ └── meson.build │ │ ├── main.cpp │ │ ├── obj │ │ │ └── meson.build │ │ └── meson.build │ ├── plugins │ │ ├── meson.build │ │ └── plugins_common.h │ └── mocks │ │ ├── meson.build │ │ └── mock_basic_plugin.cpp └── README.md ├── benchmark ├── kvbench │ ├── .python-version │ ├── __init__.py │ ├── commands │ │ └── __init__.py │ ├── models │ │ └── __init__.py │ ├── test │ │ └── __init__.py │ ├── .gitignore │ ├── examples │ │ ├── model_llama_3_1_8b.yaml │ │ ├── model_llama_3_1_70b.yaml │ │ ├── model_deepseek_r1.yaml │ │ ├── block-tp1-pp1.yaml │ │ ├── block-tp1-pp2.yaml │ │ ├── block-tp1-pp4.yaml │ │ ├── block-tp1-pp8.yaml │ │ ├── block-tp8-pp2.yaml │ │ ├── block-tp8-pp4.yaml │ │ ├── block-tp8-pp8.yaml │ │ ├── layer-tp1-pp1.yaml │ │ ├── layer-tp1-pp2.yaml │ │ ├── layer-tp1-pp4.yaml │ │ ├── layer-tp1-pp8.yaml │ │ ├── layer-tp8-pp2.yaml │ │ ├── layer-tp8-pp4.yaml │ │ ├── layer-tp8-pp8.yaml │ │ ├── block-tp1-pp16.yaml │ │ ├── block-tp8-pp16.yaml │ │ ├── block-tp8-pp32.yaml │ │ ├── layer-tp1-pp16.yaml │ │ ├── layer-tp8-pp16.yaml │ │ └── layer-tp8-pp32.yaml │ └── pyproject.toml └── nixlbench │ ├── src │ ├── worker │ │ ├── nvshmem │ │ │ └── meson.build │ │ ├── nixl │ │ │ └── meson.build │ │ └── meson.build │ ├── utils │ │ ├── meson.build │ │ └── scope_guard.h │ └── runtime │ │ ├── etcd │ │ ├── meson.build │ │ └── setup.py │ │ ├── meson.build │ │ ├── runtime.cpp │ │ └── runtime.h │ └── meson_options.txt ├── examples ├── device │ ├── ep │ │ ├── tests │ │ │ └── elastic │ │ │ │ ├── single_rank.json │ │ │ │ ├── no_expansion.json │ │ │ │ ├── single_expansion.json │ │ │ │ ├── double_expansion.json │ │ │ │ ├── single_expansion_16_ranks.json │ │ │ │ ├── expansion_contraction.json │ │ │ │ └── README.md │ │ ├── scripts │ │ │ └── reset_etcd.sh │ │ ├── nixl_ep │ │ │ └── __init__.py │ │ └── LICENSE-DeepEP │ └── meson.build ├── python │ └── remote_storage_example │ │ ├── agent_file.in │ │ ├── storage_pipeline.png │ │ ├── client_server_diagram.png │ │ └── nixl_storage_utils │ │ └── __init__.py ├── rust │ ├── README.md │ └── Cargo.toml ├── cpp │ ├── README.md │ └── meson.build ├── meson.build └── README.md ├── .codespellrc ├── docs ├── doxygen │ ├── nixl.png │ └── nixl_two_nodes.png ├── figures │ ├── nixl_sb_api.png │ └── nixl_high_level.png └── python_api.md ├── subprojects ├── prometheus-cpp.wrap ├── taskflow.wrap ├── asio.wrap └── packagefiles │ └── taskflow │ └── meson.build ├── .gitignore ├── nixl.pc.in ├── .ci └── assets │ └── nixl-version-info.template ├── contrib ├── README.md ├── tomlutil.py └── aws-efa │ ├── aws_vars.template │ └── aws_job_def.json ├── requirements.txt ├── Cargo.toml ├── CODEOWNERS ├── pyproject.toml ├── .clang-tidy ├── SECURITY.md └── .gitlab └── test_plugins.sh /src/api/python/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/copy-pr-bot.yaml: -------------------------------------------------------------------------------- 1 | enabled: true -------------------------------------------------------------------------------- /src/arch/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | -------------------------------------------------------------------------------- /test/python/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /benchmark/kvbench/.python-version: -------------------------------------------------------------------------------- 1 | 3.13 2 | -------------------------------------------------------------------------------- /src/bindings/python/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /src/bindings/rust/.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | target/* 3 | -------------------------------------------------------------------------------- /examples/device/ep/tests/elastic/single_rank.json: -------------------------------------------------------------------------------- 1 | [ 2 | [0] 3 | ] 4 | -------------------------------------------------------------------------------- /.codespellrc: -------------------------------------------------------------------------------- 1 | [codespell] 2 | ignore-words-list = crate, trait, dyn, async 3 | -------------------------------------------------------------------------------- /examples/device/ep/tests/elastic/no_expansion.json: -------------------------------------------------------------------------------- 1 | [ 2 | [0, 1, 2, 3] 3 | ] 4 | -------------------------------------------------------------------------------- /examples/python/remote_storage_example/agent_file.in: -------------------------------------------------------------------------------- 1 | target1 127.0.0.1 8888 2 | -------------------------------------------------------------------------------- /docs/doxygen/nixl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ai-dynamo/nixl/HEAD/docs/doxygen/nixl.png -------------------------------------------------------------------------------- /docs/figures/nixl_sb_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ai-dynamo/nixl/HEAD/docs/figures/nixl_sb_api.png -------------------------------------------------------------------------------- /docs/doxygen/nixl_two_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ai-dynamo/nixl/HEAD/docs/doxygen/nixl_two_nodes.png -------------------------------------------------------------------------------- /docs/figures/nixl_high_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ai-dynamo/nixl/HEAD/docs/figures/nixl_high_level.png -------------------------------------------------------------------------------- /examples/device/ep/tests/elastic/single_expansion.json: -------------------------------------------------------------------------------- 1 | [ 2 | [0, 1, 2, 3], 3 | [0, 1, 2, 3, 4, 5, 6, 7] 4 | ] 5 | -------------------------------------------------------------------------------- /examples/device/ep/tests/elastic/double_expansion.json: -------------------------------------------------------------------------------- 1 | [ 2 | [0, 1, 2, 3], 3 | [0, 1, 2, 3, 4, 5], 4 | [0, 1, 2, 3, 4, 5, 6, 7] 5 | ] 6 | -------------------------------------------------------------------------------- /examples/device/ep/tests/elastic/single_expansion_16_ranks.json: -------------------------------------------------------------------------------- 1 | [ 2 | [0, 1, 2, 3, 4, 5, 6, 7], 3 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] 4 | ] 5 | -------------------------------------------------------------------------------- /examples/python/remote_storage_example/storage_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ai-dynamo/nixl/HEAD/examples/python/remote_storage_example/storage_pipeline.png -------------------------------------------------------------------------------- /examples/python/remote_storage_example/client_server_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ai-dynamo/nixl/HEAD/examples/python/remote_storage_example/client_server_diagram.png -------------------------------------------------------------------------------- /subprojects/prometheus-cpp.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | url = https://github.com/jupp0r/prometheus-cpp.git 3 | revision = v1.3.0 4 | depth = 1 5 | clone-recursive = true 6 | method = cmake 7 | -------------------------------------------------------------------------------- /examples/device/ep/tests/elastic/expansion_contraction.json: -------------------------------------------------------------------------------- 1 | [ 2 | [0, 1, 2, 3], 3 | [0, 1, 2, 3, 4, 5, 6, 7], 4 | [0, 1, 2, 3, 4, -6, 7], 5 | [0, 1, 2, 3, 4, 5, 6, 7] 6 | ] 7 | -------------------------------------------------------------------------------- /src/bindings/python/nixl-meta/README.md: -------------------------------------------------------------------------------- 1 | # nixl 2 | 3 | This is a *meta package* that declares optional dependencies on CUDA variants. 4 | 5 | Install one of: 6 | ```bash 7 | pip install "nixl[cu12]" # for CUDA 12 8 | pip install "nixl[cu13]" # for CUDA 13 9 | ``` 10 | 11 | If both are installed, the higher version will be used. 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Rust 2 | **/target/ 3 | 4 | # Abseil-CPP 5 | subprojects/abseil-cpp-* 6 | subprojects/packagecache/ 7 | 8 | .vscode 9 | 10 | # AWS EFA test files 11 | contrib/aws-efa/aws_vars.json 12 | 13 | # TaskFlow 14 | subprojects/taskflow-* 15 | 16 | # CuFile Logs 17 | cufile.log 18 | 19 | # clangd 20 | .cache/ 21 | 22 | # Asio 23 | subprojects/asio-* -------------------------------------------------------------------------------- /subprojects/taskflow.wrap: -------------------------------------------------------------------------------- 1 | [wrap-file] 2 | directory = taskflow-3.10.0 3 | source_url = https://github.com/taskflow/taskflow/archive/refs/tags/v3.10.0.tar.gz 4 | source_filename = taskflow-3.10.0.tar.gz 5 | source_hash = fe86765da417f6ceaa2d232ffac70c9afaeb3dc0816337d39a7c93e39c2dee0b 6 | patch_directory = taskflow 7 | 8 | [provide] 9 | taskflow = taskflow_dep 10 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## What? 2 | _Describe what this PR is doing._ 3 | 4 | ## Why? 5 | _Justification for the PR. If there is an existing issue/bug, please reference it. For 6 | bug fixes, the 'Why?' and 'What?' can be merged into a single item._ 7 | 8 | ## How? 9 | _It is optional, but for complex PRs, please provide information about the design, 10 | architecture, approach, etc._ 11 | -------------------------------------------------------------------------------- /examples/rust/README.md: -------------------------------------------------------------------------------- 1 | # Rust Examples 2 | 3 | This directory contains Rust examples demonstrating NIXL usage from Rust bindings. 4 | 5 | Available example: 6 | - `src/single_process_example.rs`: Single-process transfer example 7 | 8 | Notes: 9 | - Ensure NIXL and its dependencies are built/installed as required by the Rust bindings. 10 | - See the repository root `README.md` (Rust Bindings section) for details. 11 | -------------------------------------------------------------------------------- /nixl.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@prefix@ 3 | libdir=@prefix@/@libdir@ 4 | includedir=@prefix@/@includedir@ 5 | 6 | Name: nixl 7 | Description: NVIDIA Inference Xfer Library 8 | Version: @version@ 9 | Requires: ucx 10 | Requires.private: etcd-cpp-api 11 | Libs: -L${libdir} -lnixl -lnixl_build -lnixl_common -lstream -lserdes -lucx_utils -lstdc++ 12 | Libs.private: -ldl -lrt -lpthread 13 | Cflags: -I${includedir} -I${includedir}/utils/serdes -I${includedir}/utils/common -I${includedir}/backend 14 | -------------------------------------------------------------------------------- /.github/workflows/python-checks.yml: -------------------------------------------------------------------------------- 1 | name: Python Checks 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | python-checks: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | matrix: 10 | path: 11 | - ./src 12 | - ./test 13 | - ./benchmark 14 | - ./examples/python 15 | steps: 16 | - uses: actions/checkout@v3 17 | - name: Check for print() calls in ${{ matrix.path }} 18 | run: | 19 | ./.ci/scripts/check_prints.sh ${{ matrix.path }} 20 | -------------------------------------------------------------------------------- /examples/cpp/README.md: -------------------------------------------------------------------------------- 1 | # C++ Examples 2 | 3 | This directory contains C++ examples showing how to use NIXL agents and perform transfers. 4 | 5 | Available examples: 6 | - `nixl_example.cpp`: Basic agent usage and transfers 7 | - `nixl_etcd_example.cpp`: Metadata exchange example using etcd 8 | - `telemetry_reader.cpp`: Reading transfer telemetry 9 | 10 | Run: 11 | - Binaries are generated under `build/examples/` (depending on your Meson setup). 12 | - See comments in each example source file for invocation details. 13 | -------------------------------------------------------------------------------- /test/python/conftest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | import pytest 5 | 6 | 7 | def pytest_addoption(parser): 8 | parser.addoption( 9 | "--backend", 10 | action="store", 11 | default="UCX", 12 | help="Backend plugin name to use for tests (default: UCX)", 13 | ) 14 | 15 | 16 | @pytest.fixture(scope="session") 17 | def backend_name(pytestconfig): 18 | return pytestconfig.getoption("--backend") 19 | -------------------------------------------------------------------------------- /.ci/assets/nixl-version-info.template: -------------------------------------------------------------------------------- 1 | # NIXL Container Version Information 2 | 3 | # Version information 4 | NIXL_VERSION="${NIXL_VERSION}" 5 | UCX_VERSION="${UCX_VERSION}" 6 | 7 | # Build information 8 | BUILD_TARGET="${BUILD_TARGET}" 9 | BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" 10 | ARCHITECTURE="${arch}" 11 | BASE_IMAGE_NAME="${BASE_IMAGE}" 12 | BASE_IMAGE_TAG="${BASE_IMAGE_TAG}" 13 | TAG_NAME="${TAG_NAME}" 14 | 15 | # Jenkins build information 16 | BUILD_NUMBER="${BUILD_NUMBER}" 17 | BUILD_URL="${BUILD_URL}" 18 | JOB_NAME="${JOB_NAME}" 19 | NODE_NAME="${NODE_NAME}" 20 | WORKSPACE="${WORKSPACE}" 21 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- 1 | name: Run Pre-Commit Hooks 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | pre-commit: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | with: 11 | fetch-depth: 2 12 | - name: Get modified files 13 | id: modified-files 14 | run: echo "modified_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT 15 | - uses: actions/setup-python@v3 16 | - uses: pre-commit/action@v3.0.0 17 | with: 18 | extra_args: --files ${{ steps.modified-files.outputs.modified_files }} -------------------------------------------------------------------------------- /contrib/README.md: -------------------------------------------------------------------------------- 1 | ## Build options 2 | 3 | ### Build & install in a conda environment 4 | Refer to [README.md](../README.md) for instructions on how to install prerequisites. 5 | ``` 6 | $ conda activate 7 | $ export PKG_CONFIG_PATH=/lib/pkgconfig:$PKG_CONFIG_PATH 8 | 9 | $ meson setup nixl-build -Ducx_path= --prefix= 10 | $ cd nixl-build 11 | $ ninja 12 | $ ninja install 13 | 14 | $ cd .. 15 | $ pip install . --config-settings=setup-args="-Ducx_path=" 16 | $ pip list | grep nixl 17 | $ python -c "from nixl._api import nixl_agent; print('Success')" 18 | ``` 19 | -------------------------------------------------------------------------------- /subprojects/asio.wrap: -------------------------------------------------------------------------------- 1 | [wrap-file] 2 | directory = asio-1.30.2 3 | source_url = https://sourceforge.net/projects/asio/files/asio/1.30.2%20%28Stable%29/asio-1.30.2.tar.gz/download 4 | source_filename = asio-1.30.2.tar.gz 5 | source_hash = 12e7bb4dada8bc1191de9d550a59ee658ce4e645ffc97c911c099ab4e8699d55 6 | patch_filename = asio_1.30.2-2_patch.zip 7 | patch_url = https://wrapdb.mesonbuild.com/v2/asio_1.30.2-2/get_patch 8 | patch_hash = 8bed3693016874b097e4d902c4ca8daf1b6abf1b5a56b0c5c02827d4e0747ddb 9 | source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/asio_1.30.2-2/asio-1.30.2.tar.gz 10 | wrapdb_version = 1.30.2-2 11 | 12 | [provide] 13 | asio = asio_dep 14 | -------------------------------------------------------------------------------- /benchmark/kvbench/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | -------------------------------------------------------------------------------- /benchmark/kvbench/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | -------------------------------------------------------------------------------- /benchmark/kvbench/models/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | -------------------------------------------------------------------------------- /benchmark/kvbench/test/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | -------------------------------------------------------------------------------- /src/api/cpp/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir_done() 17 | -------------------------------------------------------------------------------- /examples/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('cpp') 17 | subdir('device') 18 | -------------------------------------------------------------------------------- /src/api/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('cpp') 17 | subdir('python') 18 | -------------------------------------------------------------------------------- /src/plugins/telemetry/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('prometheus') 17 | -------------------------------------------------------------------------------- /benchmark/kvbench/.gitignore: -------------------------------------------------------------------------------- 1 | # Insta snapshots. 2 | *.pending-snap 3 | 4 | # Generated by Cargo 5 | # will have compiled files and executables 6 | debug/ 7 | target/ 8 | target-alpine/ 9 | 10 | # Bootstrapped Python versions 11 | /bin/ 12 | 13 | # These are backup files generated by rustfmt 14 | **/*.rs.bk 15 | 16 | # MSVC Windows builds of rustc generate these, which store debugging information 17 | *.pdb 18 | 19 | # Python tmp files 20 | __pycache__ 21 | test/__pycache__ 22 | # Maturin builds, and other native editable builds 23 | *.so 24 | *.pyd 25 | *.dll 26 | /dist 27 | /crates/uv-build/dist 28 | 29 | # Profiling 30 | flamegraph.svg 31 | perf.data 32 | perf.data.old 33 | profile.json 34 | 35 | # MkDocs 36 | /site 37 | 38 | # macOS 39 | **/.DS_Store 40 | 41 | # IDE 42 | .idea 43 | .vscode -------------------------------------------------------------------------------- /test/unit/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('plugins') 17 | subdir('utils') 18 | -------------------------------------------------------------------------------- /src/bindings/rust/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [toolchain] 17 | channel = "1.86.0" 18 | -------------------------------------------------------------------------------- /examples/device/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | if get_option('build_nixl_ep') 17 | subdir('ep') 18 | endif 19 | -------------------------------------------------------------------------------- /src/bindings/python/nixl-meta/nixl/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | fs = import('fs') 17 | fs.copyfile('__init__.py') 18 | -------------------------------------------------------------------------------- /src/bindings/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('python') 17 | if get_option('rust') 18 | subdir('rust') 19 | endif 20 | -------------------------------------------------------------------------------- /test/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('nixl') 17 | subdir('unit') 18 | 19 | if ucx_dep.found() 20 | subdir('gtest') 21 | endif 22 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | black 17 | flake8 18 | isort 19 | mypy 20 | pre-commit 21 | pytest 22 | pyyaml 23 | toml 24 | tomli 25 | types-PyYAML 26 | -------------------------------------------------------------------------------- /.github/workflows/copyright-checks.yml: -------------------------------------------------------------------------------- 1 | name: Copyright Checks 2 | 3 | on: 4 | pull_request 5 | 6 | jobs: 7 | copyright-checks: 8 | runs-on: ubuntu-24.04 9 | container: 10 | image: ghcr.io/ai-dynamo/dynamo/helm-tester:0.1.1 11 | options: --tty 12 | volumes: 13 | - ${{ github.workspace }}:/workspace 14 | permissions: 15 | contents: read 16 | packages: read 17 | steps: 18 | - uses: actions/checkout@v4 19 | # Allowlist both variants of the mounted source directory. 20 | - run: git config --global --add safe.directory /__w/dynamo/dynamo 21 | - run: git config --global --add safe.directory /workspace 22 | - run: /workspace/.github/workflows/copyright-check.sh 23 | shell: bash 24 | env: 25 | NVBUILD_VERBOSITY: DETAILED 26 | timeout-minutes: 2 27 | working-directory: /workspace 28 | -------------------------------------------------------------------------------- /src/bindings/rust/src/utils.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | // SPDX-License-Identifier: Apache-2.0 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use super::*; 17 | 18 | mod params; 19 | mod string_list; 20 | 21 | #[allow(unused)] 22 | pub use params::*; 23 | pub use string_list::*; 24 | -------------------------------------------------------------------------------- /test/unit/utils/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('common') 17 | if libfabric_dep.found() 18 | subdir('libfabric') 19 | endif 20 | subdir('serdes') 21 | subdir('stream') 22 | if ucx_dep.found() 23 | subdir('ucx') 24 | endif 25 | -------------------------------------------------------------------------------- /benchmark/kvbench/examples/model_llama_3_1_8b.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | model_name: 'LLAMA3.1_8B' 17 | num_layers: 32 18 | num_query_heads_with_mha: 32 19 | query_head_dimension: 128 20 | gqa_num_queries_in_group: 4 21 | num_model_params: 8000000000 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/model_llama_3_1_70b.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | model_name: 'LLAMA3.1_70B' 17 | num_layers: 80 18 | num_query_heads_with_mha: 64 19 | query_head_dimension: 128 20 | gqa_num_queries_in_group: 8 21 | num_model_params: 70000000000 22 | -------------------------------------------------------------------------------- /src/utils/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('common') 17 | subdir('serdes') 18 | if ucx_dep.found() 19 | subdir('ucx') 20 | endif 21 | subdir('stream') 22 | subdir('file') 23 | 24 | if libfabric_dep.found() 25 | subdir('libfabric') 26 | endif 27 | -------------------------------------------------------------------------------- /src/utils/common/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef UTIL_H 18 | #define UTIL_H 19 | 20 | #define CONCAT(a, b) CONCAT_0(a, b) 21 | #define CONCAT_0(a, b) a ## b 22 | #define UNIQUE_NAME(name) CONCAT(name, __COUNTER__) 23 | 24 | #endif /* UTIL_H */ 25 | -------------------------------------------------------------------------------- /test/python/desc_perf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | import time 7 | 8 | import nixl._utils as nixl_utils 9 | from nixl._api import nixl_agent 10 | from nixl.logging import get_logger 11 | 12 | logger = get_logger(__name__) 13 | 14 | if __name__ == "__main__": 15 | desc_count = 24 * 64 * 1024 16 | agent = nixl_agent("test", None) 17 | addr = nixl_utils.malloc_passthru(256) 18 | 19 | addr_list = [(addr, 256, 0)] * desc_count 20 | 21 | start_time = time.perf_counter() 22 | 23 | descs = agent.get_xfer_descs(addr_list, "DRAM") 24 | 25 | end_time = time.perf_counter() 26 | 27 | assert descs.descCount() == desc_count 28 | 29 | logger.info( 30 | "Time per desc add in us: %f", 31 | (1000000.0 * (end_time - start_time)) / desc_count, 32 | ) 33 | nixl_utils.free_passthru(addr) 34 | -------------------------------------------------------------------------------- /.github/workflows/clang-format.yml: -------------------------------------------------------------------------------- 1 | name: Clang Format Check 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | clang-format: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | with: 11 | fetch-depth: 2 12 | - name: Install clang-format-19 13 | run: | 14 | sudo apt-get update 15 | sudo apt-get install -y clang-format-19 16 | - name: Check clang-format on changed lines 17 | run: | 18 | FILE_PATTERN='\.(cpp|h|cc|c|cxx|hpp|cu|cuh)$' 19 | 20 | echo "### Modified C/C++ files:" 21 | FILES=$(git diff --name-only HEAD^1 HEAD -- . ':(exclude)examples/device/ep' | grep -E "$FILE_PATTERN") || true 22 | [ -z "$FILES" ] && echo "(none)" || echo "$FILES" 23 | 24 | echo "### clang format errors:" 25 | [ -z "$FILES" ] && echo "(no matching files)" || \ 26 | git diff -U0 HEAD^1 HEAD -- $FILES | \ 27 | clang-format-diff-19 -p1 -style=file -v -iregex ".*${FILE_PATTERN}" 28 | -------------------------------------------------------------------------------- /benchmark/kvbench/examples/model_deepseek_r1.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | model_name: 'DEEPSEEK_R1' 17 | num_layers: 61 18 | num_query_heads: 128 19 | query_head_dimension: 128 20 | embedding_dimension: 7168 21 | rope_mla_dimension: 64 22 | mla_latent_vector_dimension: 512 23 | num_model_params: 671000000000 24 | -------------------------------------------------------------------------------- /examples/device/ep/scripts/reset_etcd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | set +e 19 | pkill -9 -x etcd 20 | pkill -9 -f python 21 | rm -rf default.etcd 22 | HOST_IP=$(hostname -I | awk '{print $1}') 23 | etcd --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://${HOST_IP}:2379 & 24 | -------------------------------------------------------------------------------- /test/unit/utils/stream/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | md_streamer = executable('md_streamer', 17 | 'metadata_streamer.cpp', 18 | dependencies: [nixl_dep, nixl_infra, stream_interface], 19 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 20 | install: true) 21 | -------------------------------------------------------------------------------- /src/utils/serdes/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | serdes_lib = library('serdes', 17 | 'serdes.cpp', 'serdes.h', 18 | dependencies: [absl_log_dep], 19 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 20 | install: true) 21 | 22 | serdes_interface = declare_dependency(link_with: serdes_lib) 23 | -------------------------------------------------------------------------------- /subprojects/packagefiles/taskflow/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | project('taskflow', 'cpp', version: '3.10.0') 17 | 18 | # Taskflow is a header-only library 19 | taskflow_inc = include_directories('.') 20 | 21 | taskflow_dep = declare_dependency( 22 | include_directories: taskflow_inc, 23 | version: meson.project_version() 24 | ) 25 | -------------------------------------------------------------------------------- /test/gtest/device_api/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Device API test utilities and sources 17 | device_api_inc_dirs = include_directories('.') 18 | 19 | device_api_sources = [ 20 | 'single_write_test.cu', 21 | 'utils.cu' 22 | ] 23 | 24 | # Export for parent meson.build 25 | device_api_test_sources = files(device_api_sources) 26 | -------------------------------------------------------------------------------- /test/gtest/unit/agent/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | agent_unit_test_dep = declare_dependency( 17 | sources: [ 18 | '../../mocks/gmock_engine.cpp', 19 | 'agent.cpp', 20 | ], 21 | include_directories: [nixl_inc_dirs, gtest_inc_dirs], 22 | dependencies: [gmock_dep, nixl_common_dep], 23 | ) 24 | -------------------------------------------------------------------------------- /test/unit/utils/serdes/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | if get_option('buildtype') != 'release' 17 | 18 | serdes_test_bin = executable('serdes_test', 19 | 'serdes_test.cpp', 20 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 21 | link_with: serdes_lib, 22 | install: true) 23 | endif 24 | -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp1-pp1.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 1 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp1-pp2.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 2 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp1-pp4.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 4 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp1-pp8.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 8 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp8-pp2.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 2 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp8-pp4.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 4 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp8-pp8.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 8 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp1-pp1.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 1 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp1-pp2.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 2 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp1-pp4.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 4 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp1-pp8.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 8 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp8-pp2.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 2 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp8-pp4.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 4 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp8-pp8.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 8 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 1 -------------------------------------------------------------------------------- /src/utils/file/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | file_utils_lib = library('file_utils', 17 | 'file_utils.cpp', 'file_utils.h', 18 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 19 | dependencies: [nixl_common_dep], 20 | install: true) 21 | 22 | file_utils_interface = declare_dependency(link_with: file_utils_lib) 23 | -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp1-pp16.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 16 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp8-pp16.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 16 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 8192 24 | osl: 2048 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/block-tp8-pp32.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 32 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "block" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp1-pp16.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 1 18 | pp_size: 16 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp8-pp16.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 16 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /benchmark/kvbench/examples/layer-tp8-pp32.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | strategy: 17 | tp_size: 8 18 | pp_size: 32 19 | model_quant_mode: "fp8" 20 | kvcache_quant_mode: "fp8" 21 | 22 | runtime: 23 | isl: 1000 24 | osl: 100 25 | num_requests: 10 26 | 27 | system: 28 | hardware: "H100" 29 | backend: "SGLANG" 30 | access_pattern: "layer" 31 | page_size: 16 -------------------------------------------------------------------------------- /src/api/python/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | py = import('python').find_installation('python3', pure: false) 17 | 18 | py.install_sources('_api.py', subdir: (cuda_wheel_dir)) 19 | py.install_sources('__init__.py', subdir: (cuda_wheel_dir)) 20 | py.install_sources('py.typed', subdir: (cuda_wheel_dir)) 21 | py.install_sources('logging.py', subdir: (cuda_wheel_dir)) 22 | -------------------------------------------------------------------------------- /src/utils/README.md: -------------------------------------------------------------------------------- 1 | 17 | # utils tests 18 | 19 | There are a handful of unit tests in this directory, described here: 20 | 21 | - src/utils/serdes_test.cpp - test for just serialization/deserialization functions 22 | - src/utils/ucx/ucx_worker_test.cpp - test for all UCX utility functions 23 | - src/utils/ucx/ucx_am_test.cpp - test for UCX active message utilities 24 | -------------------------------------------------------------------------------- /src/utils/stream/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | stream_lib = library('stream', 17 | 'metadata_stream.cpp', 'metadata_stream.h', 18 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 19 | dependencies: [thread_dep, nixl_common_dep], 20 | install: true) 21 | 22 | stream_interface = declare_dependency(link_with: stream_lib) 23 | -------------------------------------------------------------------------------- /test/gtest/unit/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include 18 | 19 | namespace gtest { 20 | 21 | int 22 | RunTests(int argc, char **argv) { 23 | testing::InitGoogleTest(&argc, argv); 24 | return RUN_ALL_TESTS(); 25 | } 26 | 27 | } // namespace gtest 28 | 29 | int 30 | main(int argc, char **argv) { 31 | return gtest::RunTests(argc, argv); 32 | } 33 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/worker/nvshmem/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | if nvshmem_available 17 | nvshmem_worker_sources = [ 18 | 'nvshmem_worker.cpp', 19 | 'nvshmem_worker.h', 20 | ] 21 | 22 | nvshmem_worker_lib = static_library('nvshmemWorker', 23 | nvshmem_worker_sources, 24 | include_directories: inc_dir, 25 | dependencies: [cuda_dep, nvshmem_lib], 26 | install: true, 27 | ) 28 | endif -------------------------------------------------------------------------------- /test/unit/plugins/cuda_gds/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | if cuda_dep.found() == false 17 | subdir_done() 18 | endif 19 | 20 | nixl_gds_app = executable('nixl_gds_test', 'nixl_gds_test.cpp', 21 | dependencies: [nixl_dep, nixl_infra, cuda_dep], 22 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 23 | install: true) 24 | -------------------------------------------------------------------------------- /examples/device/ep/tests/elastic/README.md: -------------------------------------------------------------------------------- 1 | ### Elastic Test Suite 2 | 3 | #### Single Node (8 ranks, 4→8 expansion): 4 | ```bash 5 | python3 tests/elastic/elastic.py \ 6 | --plan tests/elastic/single_expansion.json \ 7 | --num-processes 8 \ 8 | --etcd-server http://127.0.0.1:2379 9 | ``` 10 | 11 | #### Multi-Node Setup: 12 | 13 | **Node 1** (will launch the first phase with 4 ranks): 14 | ```bash 15 | python3 tests/elastic/elastic.py \ 16 | --plan tests/elastic/single_expansion.json \ 17 | --num-processes 4 \ 18 | ``` 19 | 20 | **Node 2** (will join the second phase with additional 4 ranks): 21 | ```bash 22 | python3 tests/elastic/elastic.py \ 23 | --plan tests/elastic/single_expansion.json \ 24 | --num-processes 4 \ 25 | --rank-server $MASTER_IP \ 26 | --etcd-server http://$MASTER_IP:2379 27 | ``` 28 | 29 | ### Available Test Plans 30 | 31 | - `no_expansion.json`: Static 4 ranks (baseline) 32 | - `single_expansion.json`: 4 → 8 ranks (single expansion) 33 | - `double_expansion.json`: 4 → 6 → 8 ranks (two expansions) 34 | - `expansion_contraction.json`: 4 → 8 → 6 ranks (scale up then down) 35 | -------------------------------------------------------------------------------- /test/unit/plugins/gds_mt/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | if cuda_dep.found() == false 17 | subdir_done() 18 | endif 19 | 20 | nixl_gds_mt_app = executable('nixl_gds_mt_test', 'nixl_gds_mt_test.cpp', 21 | dependencies: [nixl_dep, nixl_infra, cuda_dep], 22 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 23 | install: true) 24 | -------------------------------------------------------------------------------- /.github/workflows/pr-size-check.yml: -------------------------------------------------------------------------------- 1 | name: PR Size Check 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | check-pr-size: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout code 10 | uses: actions/checkout@v3 11 | with: 12 | fetch-depth: 2 # Need full history to compare with base branch 13 | 14 | - name: Check PR size 15 | run: | 16 | # Calculate detailed breakdown of changes 17 | echo "📊 Analyzing PR changes..." 18 | echo "" 19 | 20 | # Lines added to existing files (excluding subprojects) 21 | LINES_CHANGED=$(git show --numstat --pretty="" --diff-filter=M -- . ':(exclude)subprojects/*' | awk '{s+=$1} END {print s}') 22 | 23 | if [[ "$LINES_CHANGED" -gt 500 ]]; then 24 | echo "❌ PR size check failed!" 25 | echo "This PR adds $LINES_CHANGED lines (excluding subprojects), which exceeds the maximum of 500 lines." 26 | exit 1 27 | else 28 | echo "✅ PR size check passed!" 29 | echo "This PR adds $LINES_CHANGED lines (excluding subprojects), which is within the 500 line limit." 30 | fi 31 | -------------------------------------------------------------------------------- /examples/device/ep/nixl_ep/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 DeepSeek 2 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | # 4 | # This file incorporates material from the DeepSeek project, licensed under the MIT License. 5 | # The modifications made by NVIDIA are licensed under the Apache License, Version 2.0. 6 | # 7 | # SPDX-License-Identifier: MIT AND Apache-2.0 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | from .buffer import Buffer 22 | from .utils import EventOverlap 23 | 24 | __all__ = ["Buffer", "EventOverlap"] 25 | -------------------------------------------------------------------------------- /src/plugins/hf3fs/hf3fs_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef HF3FS_LOG_H 18 | #define HF3FS_LOG_H 19 | 20 | #include 21 | #include "common/nixl_log.h" 22 | 23 | #define HF3FS_LOG_RETURN(error_code, message) \ 24 | do { \ 25 | NIXL_ERROR << absl::StrFormat("HF3FS error: %d - %s", (error_code), (message)); \ 26 | return error_code; \ 27 | } while (0) 28 | 29 | #endif // HF3FS_LOG_H 30 | -------------------------------------------------------------------------------- /examples/device/ep/LICENSE-DeepEP: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 DeepSeek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/worker/nixl/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | nixl_worker_sources = [ 17 | 'nixl_worker.cpp', 18 | 'nixl_worker.h', 19 | ] 20 | 21 | nixl_worker_deps = [openmp_dep, nixl_lib, nixl_build, nixl_serdes] 22 | if cuda_available 23 | nixl_worker_deps += [cuda_dep] 24 | endif 25 | 26 | nixl_worker_lib = static_library('nixl_worker', 27 | nixl_worker_sources, 28 | include_directories: inc_dir, 29 | dependencies: nixl_worker_deps, 30 | install: true, 31 | ) -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # NIXL Examples 2 | 3 | This directory contains runnable examples across Python, C++, and Rust. 4 | 5 | The `examples/python/basic_two_peers.py` is a good starting point to learn the basic usage of NIXL end-to-end. 6 | It shows basic registration, metadata exchange, and transfer operations. 7 | 8 | The `examples/python/expanded_two_peers.py` further extends the basic example with more use cases and demonstrates: 9 | - Registration best practice: fewer, larger registrations reduce kernel calls and internal lookups 10 | - Creating descriptors used for transfers in various modes, from tensor, python tuples, numpy 11 | - Creating transfers in different modes: 12 | - Prepped flow (prep_xfer_dlist + make_prepped_xfer): when blocks are known in advance, prepare once and choose indices/mappings at runtime 13 | - Combined flow (initialize_xfer): NIXL prepares and creates the transfer handle in one step; useful when there is no fixed notion of blocks 14 | - Application-driven ordering vs. parallelism (posting groups and waiting to enforce order) 15 | - Reposting transfer handles after completion 16 | - Notification checks, data verification, and explicit teardown at the end 17 | -------------------------------------------------------------------------------- /examples/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [package] 17 | name = "nixl-examples" 18 | version = "0.1.1" 19 | edition = "2021" 20 | 21 | [dependencies] 22 | nixl-sys = { path = "../../src/bindings/rust" } 23 | clap = { version = "4.5.38", features = ["derive"] } 24 | tracing = "0.1" 25 | tracing-subscriber = "0.3" 26 | tokio = { version = "1.45", features = ["full"] } 27 | chrono = "0.4" 28 | 29 | [[bin]] 30 | name = "single_process_example" 31 | path = "src/single_process_example.rs" 32 | -------------------------------------------------------------------------------- /src/api/python/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | from ._api import ( 17 | DEFAULT_COMM_PORT, 18 | nixl_agent, 19 | nixl_agent_config, 20 | nixl_backend_handle, 21 | nixl_prepped_dlist_handle, 22 | nixl_xfer_handle, 23 | ) 24 | 25 | __all__ = [ 26 | # Constants 27 | "DEFAULT_COMM_PORT", 28 | # Main classes 29 | "nixl_agent", 30 | "nixl_agent_config", 31 | "nixl_backend_handle", 32 | "nixl_prepped_dlist_handle", 33 | "nixl_xfer_handle", 34 | ] 35 | -------------------------------------------------------------------------------- /test/gtest/unit/obj/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | obj_unit_test_dep = declare_dependency( 17 | sources: [ 18 | 'obj.cpp', 19 | ], 20 | include_directories: [ 21 | nixl_inc_dirs, 22 | '../../../../src/plugins/obj', 23 | ], 24 | dependencies: [ 25 | aws_s3.partial_dependency(compile_args: false, includes: true, link_args: true, links: true), 26 | dependency('asio', required: true), 27 | ], 28 | link_with: obj_backend_lib, 29 | ) 30 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/utils/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | utils_sources = [ 17 | 'utils.cpp', 18 | 'utils.h', 19 | 'scope_guard.h' 20 | ] 21 | 22 | utils_deps = [ 23 | cuda_dep, 24 | gflags_dep, 25 | openmp_dep 26 | ] 27 | 28 | utils_lib = static_library('utils', 29 | utils_sources, 30 | dependencies: utils_deps, 31 | include_directories: inc_dir 32 | ) 33 | utils_dep = declare_dependency( 34 | link_with: utils_lib, 35 | dependencies: utils_deps, 36 | include_directories: inc_dir 37 | ) 38 | 39 | -------------------------------------------------------------------------------- /src/core/telemetry/buffer_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "buffer_exporter.h" 19 | #include "telemetry/telemetry_plugin.h" 20 | #include "telemetry/telemetry_exporter.h" 21 | 22 | // Plugin type alias for convenience 23 | using buffer_exporter_plugin_t = nixlTelemetryPluginCreator; 24 | 25 | nixlTelemetryPlugin * 26 | createStaticBUFFERPlugin() { 27 | return buffer_exporter_plugin_t::create(nixlTelemetryPluginApiVersionV1, "buffer", "1.0.0"); 28 | } 29 | -------------------------------------------------------------------------------- /test/unit/plugins/gusli/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Get Abseil dependencies 17 | absl_log_dep = dependency('absl_log', required: true) 18 | 19 | nixl_gusli_app = executable('nixl_gusli_test', 'nixl_gusli_test.cpp', 20 | dependencies: [nixl_dep, nixl_infra, absl_log_dep, nixl_test_utils_dep], 21 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 22 | install: true) 23 | 24 | # Register the test with the test suite 25 | test('gusli_plugin_test', nixl_gusli_app) 26 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [workspace] 17 | members = [ 18 | "src/bindings/rust/" 19 | ] 20 | resolver = "3" 21 | 22 | [workspace.package] 23 | version = "0.9.0" 24 | edition = "2021" 25 | description = "Low-level bindings to NIXL - NVIDIA Inference Xfer Library" 26 | authors = ["NIXL Developers "] 27 | license = "MIT AND Apache-2.0" 28 | homepage = "https://github.com/ai-dynamo/nixl" 29 | repository = "https://github.com/ai-dynamo/nixl.git" 30 | keywords = ["gpu", "inference", "distributed", "networking", "nvidia"] 31 | readme = "README.md" 32 | -------------------------------------------------------------------------------- /examples/python/remote_storage_example/nixl_storage_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | """ 17 | NIXL Storage Utilities Module 18 | Provides utilities for high-performance storage transfers using NIXL. 19 | """ 20 | 21 | from .common import ( 22 | cleanup_resources, 23 | create_agent_with_plugins, 24 | get_base_parser, 25 | setup_memory_and_files, 26 | wait_for_transfer, 27 | ) 28 | 29 | __all__ = [ 30 | "create_agent_with_plugins", 31 | "setup_memory_and_files", 32 | "cleanup_resources", 33 | "get_base_parser", 34 | "wait_for_transfer", 35 | ] 36 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Default owners are maintainers 2 | * @ai-dynamo/nixl-maintainers 3 | 4 | # CI/CD 5 | /.github/ @ai-dynamo/Devops @ai-dynamo/nixl-devops 6 | /.ci/ @ai-dynamo/nixl-devops 7 | CODEOWNERS @ai-dynamo/Devops @ai-dynamo/nixl-maintainers 8 | 9 | # Legal 10 | /ATTRIBUTIONS.md @ai-dynamo/Devops 11 | /CODE_OF_CONDUCT.md @ai-dynamo/Devops 12 | /CONTRIBUTING.md @ai-dynamo/Devops @ai-dynamo/nixl-maintainers 13 | /LICENSE @ai-dynamo/Devops 14 | /SECURITY.md @ai-dynamo/Devops 15 | 16 | # Bindings 17 | /src/bindings/python @ovidiusm @mkhazraee @roiedanino 18 | /src/bindings/rust @roiedanino @gleon99 @mkhazraee 19 | 20 | # UCX Plugins 21 | /src/plugins/ucx* @brminich @yosefe @gleon99 22 | /src/utils/ucx @brminich @yosefe @gleon99 23 | 24 | # Storage Plugins 25 | /src/plugins/posix @w1ldptr @barneuman @etoledano @vvenkates27 26 | /src/plugins/hf3fs @w1ldptr @barneuman @etoledano @vvenkates27 27 | /src/plugins/cuda_gds @w1ldptr @barneuman @etoledano @vvenkates27 28 | /src/plugins/obj @w1ldptr @barneuman @etoledano @vvenkates27 29 | 30 | # Benchmarks 31 | /benchmark @aranadive @ovidiusm @brminich 32 | 33 | # Libfabric Plugins 34 | /src/plugins/libfabric* @amitrad-aws @yexiang-aws @akkart-aws @fengjica 35 | /src/utils/libfabric @amitrad-aws @yexiang-aws @akkart-aws @fengjica 36 | /test/unit/utils/libfabric @amitrad-aws @yexiang-aws @akkart-aws @fengjica 37 | -------------------------------------------------------------------------------- /src/infra/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | nixl_build_lib = library('nixl_build', 17 | 'nixl_descriptors.cpp', 18 | 'nixl_memory_section.cpp', 19 | include_directories: [ nixl_inc_dirs, utils_inc_dirs ], 20 | dependencies: [serdes_interface, nixl_common_dep], 21 | install: true) 22 | 23 | nixl_infra = declare_dependency(link_with: nixl_build_lib) 24 | 25 | # Test utilities library that can depend on nixl_dep (created after nixl_dep is defined) 26 | # This will be defined in a separate meson file to avoid circular dependencies 27 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [build-system] 17 | requires = ["meson-python", "pybind11", "patchelf", "pyyaml", "types-PyYAML", "pytest", "build", "setuptools>=80.9.0"] 18 | build-backend = "mesonpy" 19 | 20 | [project] 21 | name = "nixl-cu12" 22 | version = "0.9.0" 23 | description = "NIXL Python API" 24 | readme = "README.md" 25 | license = "MIT AND Apache-2.0" 26 | license-files = ["LICENSE"] 27 | requires-python = ">=3.10" 28 | authors = [ 29 | {name = "NIXL Developers", email = "nixl-developers@nvidia.com"} 30 | ] 31 | 32 | dependencies = ["torch", "numpy"] 33 | 34 | [tool.isort] 35 | profile = "black" 36 | 37 | [tool.meson-python.args] 38 | setup = ["-Dinstall_headers=false"] 39 | -------------------------------------------------------------------------------- /test/unit/plugins/posix/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Using globally defined has_posix_plugin from the root meson.build 17 | if has_posix_plugin 18 | # Get Abseil dependencies 19 | absl_log_dep = dependency('absl_log', required: true) 20 | 21 | nixl_posix_app = executable('nixl_posix_test', 'nixl_posix_test.cpp', 22 | dependencies: [nixl_dep, nixl_infra, absl_log_dep], 23 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 24 | install: true) 25 | 26 | # Register the test with the test suite 27 | test('posix_plugin_test', nixl_posix_app) 28 | endif 29 | -------------------------------------------------------------------------------- /test/unit/plugins/hf3fs/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Get Abseil dependencies 17 | absl_log_dep = dependency('absl_log', required: true) 18 | 19 | nixl_hf3fs_app = executable('nixl_hf3fs_test', 'nixl_hf3fs_test.cpp', 20 | dependencies: [nixl_dep, nixl_infra], 21 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 22 | install: true) 23 | 24 | nixl_hf3fs_mt_app = executable('nixl_hf3fs_mt_test', 'nixl_hf3fs_mt_test.cpp', 25 | dependencies: [nixl_dep, nixl_infra, absl_log_dep], 26 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 27 | install: true) -------------------------------------------------------------------------------- /contrib/tomlutil.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | import argparse 19 | 20 | import tomlkit 21 | 22 | parser = argparse.ArgumentParser() 23 | parser.add_argument("--wheel-name", type=str, help="Set the project name") 24 | parser.add_argument("file", type=str, help="The toml file to modify") 25 | args = parser.parse_args() 26 | 27 | with open(args.file) as f: 28 | doc = tomlkit.parse(f.read()) 29 | 30 | if args.wheel_name: 31 | # Set the wheel name 32 | # Example: 33 | # ```toml 34 | # [project] 35 | # name = "" 36 | # ``` 37 | doc["project"]["name"] = args.wheel_name 38 | 39 | with open(args.file, "w") as f: 40 | f.write(tomlkit.dumps(doc)) 41 | -------------------------------------------------------------------------------- /src/utils/common/operators.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef NIXL_SRC_UTILS_COMMON_OPERATORS_H 18 | #define NIXL_SRC_UTILS_COMMON_OPERATORS_H 19 | 20 | #include 21 | 22 | #include "nixl_types.h" 23 | 24 | inline std::ostream & 25 | operator<<(std::ostream &os, const nixl_mem_t value) { 26 | return os << nixlEnumStrings::memTypeStr(value); 27 | } 28 | 29 | inline std::ostream & 30 | operator<<(std::ostream &os, const nixl_xfer_op_t value) { 31 | return os << nixlEnumStrings::xferOpStr(value); 32 | } 33 | 34 | inline std::ostream & 35 | operator<<(std::ostream &os, const nixl_status_t value) { 36 | return os << nixlEnumStrings::statusStr(value); 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /benchmark/kvbench/pyproject.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [project] 17 | name = "NIXLKVBench" 18 | version = "0.2.0" 19 | description = "Benchmarking utility for testing KVCache transfers in large language models (LLMs) using the NIXL runtime." 20 | readme = "README.md" 21 | requires-python = ">=3.10" 22 | dependencies = [ 23 | "click==8.1.7", 24 | "pytest==7.4.4", 25 | "pyyaml>=6.0.2", 26 | "etcd3>=0.12.0", 27 | "tabulate==0.9.0", 28 | "torch>=2.7.0", 29 | "tqdm==4.66.5", 30 | "numpy", 31 | "nixl", 32 | ] 33 | 34 | [tool.setuptools.packages.find] 35 | include = ["models*", "runtime*", "commands*"] 36 | 37 | [build-system] 38 | requires = ["setuptools>=61.0"] 39 | build-backend = "setuptools.build_meta" 40 | -------------------------------------------------------------------------------- /src/plugins/posix/queue_factory_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef QUEUE_FACTORY_IMPL_H 19 | #define QUEUE_FACTORY_IMPL_H 20 | 21 | #include "posix_queue.h" 22 | 23 | namespace QueueFactory { 24 | std::unique_ptr 25 | createPosixAioQueue(int num_entries, nixl_xfer_op_t operation); 26 | 27 | std::unique_ptr 28 | createUringQueue(int num_entries, nixl_xfer_op_t operation); 29 | 30 | std::unique_ptr 31 | createLinuxAioQueue(int num_entries, nixl_xfer_op_t operation); 32 | 33 | bool 34 | isPosixAioAvailable(); 35 | bool 36 | isLinuxAioAvailable(); 37 | bool 38 | isUringAvailable(); 39 | }; // namespace QueueFactory 40 | 41 | #endif // QUEUE_FACTORY_IMPL_H 42 | -------------------------------------------------------------------------------- /src/bindings/python/nixl-meta/pyproject.toml.in: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [build-system] 17 | requires = ["setuptools>=80.9.0"] 18 | build-backend = "setuptools.build_meta" 19 | 20 | [project] 21 | name = "nixl" 22 | version = "@VERSION@" 23 | description = "NIXL Python API meta package for CUDA variants" 24 | readme = "README.md" 25 | license = "MIT AND Apache-2.0" 26 | license-files = ["LICENSE"] 27 | requires-python = ">=3.10" 28 | authors = [ 29 | {name = "NIXL Developers", email = "nixl-developers@nvidia.com"} 30 | ] 31 | 32 | dependencies = ["@WHEEL_DEP@>=@VERSION@"] 33 | 34 | [project.optional-dependencies] 35 | cu12 = ["nixl-cu12>=@VERSION@"] 36 | cu13 = ["nixl-cu13>=@VERSION@"] 37 | 38 | [tool.setuptools] 39 | packages = ["nixl"] 40 | -------------------------------------------------------------------------------- /test/gtest/unit/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | unit_test_deps = [ 17 | nixl_dep, 18 | gtest_dep, 19 | ] 20 | 21 | aws_s3 = dependency('aws-cpp-sdk-s3', static: false, required: false) 22 | if aws_s3.found() 23 | subdir('obj') 24 | unit_test_deps += [obj_unit_test_dep] 25 | endif 26 | 27 | subdir('agent') 28 | unit_test_deps += [agent_unit_test_dep] 29 | 30 | unit_test_exe = executable('unit', 31 | sources : [ 32 | 'main.cpp', 33 | ], 34 | cpp_args : cpp_args, 35 | dependencies : unit_test_deps, 36 | include_directories: [ 37 | nixl_inc_dirs, 38 | utils_inc_dirs, 39 | ], 40 | link_with: [nixl_build_lib], 41 | install : true 42 | ) 43 | 44 | test('unit', unit_test_exe) 45 | -------------------------------------------------------------------------------- /src/bindings/python/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | pybind_dep = dependency('pybind11') 17 | 18 | nixl_dep = declare_dependency(link_with: nixl_lib, include_directories: nixl_inc_dirs) 19 | 20 | py = import('python').find_installation('python3', pure: false) 21 | 22 | py.extension_module('_bindings', 23 | 'nixl_bindings.cpp', 24 | subdir: (cuda_wheel_dir), 25 | dependencies: [nixl_dep, serdes_interface, pybind_dep], 26 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 27 | install: true) 28 | 29 | py.extension_module('_utils', 30 | 'nixl_utils.cpp', 31 | subdir: (cuda_wheel_dir), 32 | dependencies: [pybind_dep], 33 | install: true) 34 | 35 | subdir('nixl-meta') 36 | -------------------------------------------------------------------------------- /src/utils/ucx/rkey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef NIXL_SRC_UTILS_UCX_RKEY_H 19 | #define NIXL_SRC_UTILS_UCX_RKEY_H 20 | 21 | #include 22 | 23 | extern "C" { 24 | #include 25 | } 26 | 27 | class nixlUcxEp; 28 | 29 | namespace nixl::ucx { 30 | class rkey { 31 | public: 32 | rkey() = delete; 33 | rkey(const nixlUcxEp &, const void *rkey_buffer); 34 | 35 | [[nodiscard]] ucp_rkey_h 36 | get() const noexcept { 37 | return rkey_.get(); 38 | } 39 | 40 | private: 41 | [[nodiscard]] static ucp_rkey_h 42 | unpackUcpRkey(const nixlUcxEp &, const void *rkey_buffer); 43 | 44 | const std::unique_ptr rkey_; 45 | }; 46 | } // namespace nixl::ucx 47 | #endif 48 | -------------------------------------------------------------------------------- /test/unit/plugins/mooncake/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | mooncake_backend_dep = declare_dependency(link_with: mooncake_backend_lib, include_directories: [nixl_inc_dirs, '../../../../src/plugins/mooncake']) 17 | 18 | if cuda_dep.found() 19 | cuda_dependencies = [cuda_dep] 20 | cpp_args = '-DHAVE_CUDA' 21 | else 22 | cuda_dependencies = [] 23 | cpp_args = '-UHAVE_CUDA' 24 | endif 25 | 26 | mooncake_backend_test = executable('mooncake_backend_test', 27 | 'mooncake_backend_test.cpp', 28 | dependencies: [nixl_dep, nixl_infra, mooncake_backend_dep, thread_dep] + cuda_dependencies, 29 | include_directories: [nixl_inc_dirs, utils_inc_dirs, '../../../../src/plugins/mooncake'], 30 | cpp_args : cpp_args, 31 | install: true) 32 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/worker/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | worker_sources = [ 17 | 'worker.cpp', 18 | 'worker.h', 19 | ] 20 | 21 | worker_deps = [ 22 | cuda_dep, 23 | gflags_dep, 24 | openmp_dep, 25 | etcd_dep 26 | ] 27 | 28 | worker_lib = static_library('worker', 29 | worker_sources, 30 | dependencies: [worker_deps], 31 | include_directories: inc_dir 32 | ) 33 | 34 | worker_dep = declare_dependency( 35 | link_with: worker_lib, 36 | dependencies: [worker_deps], 37 | include_directories: inc_dir 38 | ) 39 | 40 | # Include subdirectories 41 | subdir('nixl') 42 | subdir('nvshmem') 43 | 44 | # Combine all worker libraries 45 | worker_libs = [worker_lib, nixl_worker_lib] 46 | if nvshmem_available 47 | worker_libs += [nvshmem_worker_lib] 48 | endif 49 | -------------------------------------------------------------------------------- /src/utils/ucx/rkey.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "rkey.h" 19 | 20 | #include "common/nixl_log.h" 21 | #include "ucx_utils.h" 22 | 23 | namespace nixl::ucx { 24 | rkey::rkey(const nixlUcxEp &ep, const void *rkey_buffer) 25 | : rkey_{unpackUcpRkey(ep, rkey_buffer), &ucp_rkey_destroy} {} 26 | 27 | ucp_rkey_h 28 | rkey::unpackUcpRkey(const nixlUcxEp &ep, const void *rkey_buffer) { 29 | ucp_rkey_h rkey = nullptr; 30 | const auto status = ucp_ep_rkey_unpack(ep.getEp(), rkey_buffer, &rkey); 31 | if (status != UCS_OK) { 32 | throw std::runtime_error(std::string("Failed to unpack UCX rkey: ") + 33 | ucs_status_string(status)); 34 | } 35 | return rkey; 36 | } 37 | } // namespace nixl::ucx 38 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/utils/scope_guard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __SCOPE_GUARD_H 19 | #define __SCOPE_GUARD_H 20 | 21 | #include 22 | 23 | template 24 | class ScopeGuard { 25 | public: 26 | explicit ScopeGuard(F func) : func_(std::move(func)) {} 27 | 28 | ScopeGuard(const ScopeGuard&) = delete; 29 | ScopeGuard(ScopeGuard&& other) = delete; 30 | ScopeGuard& operator=(const ScopeGuard&) = delete; 31 | 32 | ~ScopeGuard() { 33 | func_(); 34 | } 35 | 36 | private: 37 | F func_; 38 | }; 39 | 40 | // Factory function to simplify creation 41 | template 42 | ScopeGuard make_scope_guard(F func) { 43 | return ScopeGuard(std::move(func)); 44 | } 45 | 46 | #endif // __SCOPE_GUARD_H 47 | -------------------------------------------------------------------------------- /.github/workflows/build_validation.yml: -------------------------------------------------------------------------------- 1 | name: NVIDIA NIXL Validation 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - "pull-request/[0-9]+" 8 | 9 | jobs: 10 | mirror_repo: 11 | name: Mirror Repository to GitLab 12 | environment: GITLAB 13 | runs-on: gitlab 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v4 17 | - name: Sync Mirror Repository 18 | run: ./.github/workflows/mirror_repo.sh ${{ secrets.MIRROR_TOKEN }} ${{ secrets.MIRROR_URL }} 19 | 20 | trigger-ci: 21 | name: Trigger CI Pipeline 22 | environment: GITLAB 23 | needs: mirror_repo 24 | runs-on: gitlab 25 | steps: 26 | - name: Trigger Pipeline 27 | run: | 28 | #!/bin/bash -e 29 | declare -A ci_variables 30 | 31 | # Add variables to be passed to the pipeline 32 | ci_args="" 33 | for key in "${!ci_variables[@]}"; do 34 | ci_args+="--form variables[$key]=${ci_variables[$key]} " 35 | done 36 | 37 | echo "Running Pipeline with Variables: $ci_args" 38 | 39 | if [ "${{ github.event_name }}" = "pull_request" ]; then 40 | REF="${{ github.event.pull_request.head.ref }}" 41 | else 42 | REF="${{ github.ref }}" 43 | fi 44 | curl --fail-with-body \ 45 | --request POST \ 46 | --form token=${{ secrets.PIPELINE_TOKEN }} \ 47 | --form ref=${REF} \ 48 | $ci_args \ 49 | "${{ secrets.PIPELINE_URL }}" -------------------------------------------------------------------------------- /benchmark/nixlbench/src/runtime/etcd/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | etcd_rt_sources = [ 17 | 'etcd_rt.cpp', 18 | 'etcd_rt.h', 19 | ] 20 | 21 | etcd_rt_lib = static_library('etcd_rt', 22 | etcd_rt_sources, 23 | include_directories: inc_dir, 24 | dependencies: [etcd_dep], 25 | install: true, 26 | ) 27 | 28 | # Python bindings 29 | python = import('python').find_installation('python3', required: false) 30 | pybind11_dep = dependency('pybind11', required: false) 31 | 32 | if python.found() and pybind11_dep.found() 33 | py_mod = python.extension_module('etcd_runtime', 34 | 'python_bindings.cpp', 35 | include_directories: inc_dir, 36 | dependencies: [etcd_dep, pybind11_dep], 37 | link_with: etcd_rt_lib, 38 | install: true, 39 | subdir: 'nixlbench' 40 | ) 41 | endif 42 | -------------------------------------------------------------------------------- /src/plugins/cuda_gds/gds_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "backend/backend_plugin.h" 19 | #include "gds_backend.h" 20 | 21 | 22 | // Plugin type alias for convenience 23 | using gds_plugin_t = nixlBackendPluginCreator; 24 | 25 | #ifdef STATIC_PLUGIN_GDS 26 | nixlBackendPlugin * 27 | createStaticGDSPlugin() { 28 | return gds_plugin_t::create( 29 | NIXL_PLUGIN_API_VERSION, "GDS", "0.1.1", {}, {DRAM_SEG, VRAM_SEG, FILE_SEG}); 30 | } 31 | #else 32 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 33 | nixl_plugin_init() { 34 | return gds_plugin_t::create( 35 | NIXL_PLUGIN_API_VERSION, "GDS", "0.1.1", {}, {DRAM_SEG, VRAM_SEG, FILE_SEG}); 36 | } 37 | 38 | extern "C" NIXL_PLUGIN_EXPORT void 39 | nixl_plugin_fini() {} 40 | #endif 41 | -------------------------------------------------------------------------------- /src/plugins/obj/obj_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "nixl_types.h" 19 | #include "obj_backend.h" 20 | #include "backend/backend_plugin.h" 21 | #include "common/nixl_log.h" 22 | 23 | // Plugin type alias for convenience 24 | using obj_plugin_t = nixlBackendPluginCreator; 25 | 26 | #ifdef STATIC_PLUGIN_OBJ 27 | nixlBackendPlugin * 28 | createStaticOBJPlugin() { 29 | return obj_plugin_t::create(NIXL_PLUGIN_API_VERSION, "OBJ", "0.1.0", {}, {DRAM_SEG, OBJ_SEG}); 30 | } 31 | #else 32 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 33 | nixl_plugin_init() { 34 | return obj_plugin_t::create(NIXL_PLUGIN_API_VERSION, "OBJ", "0.1.0", {}, {DRAM_SEG, OBJ_SEG}); 35 | } 36 | 37 | extern "C" NIXL_PLUGIN_EXPORT void 38 | nixl_plugin_fini() {} 39 | #endif 40 | -------------------------------------------------------------------------------- /src/utils/ucx/gpu_xfer_req_h.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef NIXL_SRC_UTILS_UCX_GPU_XFER_REQ_H_H 19 | #define NIXL_SRC_UTILS_UCX_GPU_XFER_REQ_H_H 20 | 21 | #include 22 | 23 | #include "nixl_types.h" 24 | 25 | class nixlUcxEp; 26 | class nixlUcxMem; 27 | class nixlUcxWorker; 28 | 29 | namespace nixl::ucx { 30 | class rkey; 31 | 32 | nixlGpuXferReqH 33 | createGpuXferReq(const nixlUcxEp &ep, 34 | nixlUcxWorker &worker, 35 | const std::vector &local_mems, 36 | const std::vector &remote_rkeys, 37 | const std::vector &remote_addrs); 38 | 39 | void 40 | releaseGpuXferReq(nixlGpuXferReqH gpu_req) noexcept; 41 | } // namespace nixl::ucx 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /test/unit/utils/common/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | if cuda_dep.found() 17 | cuda_dependencies = [cuda_dep] 18 | cpp_args = '-DUSE_VRAM' 19 | else 20 | cuda_dependencies = [] 21 | cpp_args = '-UUSE_VRAM' 22 | endif 23 | 24 | p2p_socket = executable('p2p_test', 25 | 'p2p_socket_test.cpp', 26 | dependencies: [nixl_dep, nixl_infra, stream_interface] + cuda_dependencies, 27 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 28 | install: true) 29 | 30 | map_perf_test = executable('map_perf_test', 31 | 'map_perf.cpp', 32 | dependencies: [nixl_test_utils_dep], 33 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 34 | install: true) 35 | -------------------------------------------------------------------------------- /src/plugins/posix/posix_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include "posix_backend.h" 20 | #include "backend/backend_plugin.h" 21 | 22 | // Plugin type alias for convenience 23 | using posix_plugin_t = nixlBackendPluginCreator; 24 | 25 | #ifdef STATIC_PLUGIN_POSIX 26 | nixlBackendPlugin * 27 | createStaticPOSIXPlugin() { 28 | return posix_plugin_t::create( 29 | NIXL_PLUGIN_API_VERSION, "POSIX", "0.1.0", {}, {DRAM_SEG, FILE_SEG}); 30 | } 31 | #else 32 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 33 | nixl_plugin_init() { 34 | return posix_plugin_t::create( 35 | NIXL_PLUGIN_API_VERSION, "POSIX", "0.1.0", {}, {DRAM_SEG, FILE_SEG}); 36 | } 37 | 38 | extern "C" NIXL_PLUGIN_EXPORT void 39 | nixl_plugin_fini() {} 40 | #endif 41 | -------------------------------------------------------------------------------- /src/plugins/posix/posix_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef POSIX_QUEUE_H 19 | #define POSIX_QUEUE_H 20 | 21 | #include "nixl_types.h" 22 | #include "backend/backend_aux.h" 23 | #include 24 | 25 | // Abstract base class for async I/O operations 26 | class nixlPosixQueue { 27 | public: 28 | virtual ~nixlPosixQueue() = default; 29 | virtual nixl_status_t 30 | submit(const nixl_meta_dlist_t &local, const nixl_meta_dlist_t &remote) = 0; 31 | virtual nixl_status_t 32 | checkCompleted() = 0; 33 | virtual nixl_status_t 34 | prepIO(int fd, void *buf, size_t len, off_t offset) = 0; 35 | 36 | enum class queue_t { 37 | AIO, 38 | URING, 39 | POSIXAIO, 40 | UNSUPPORTED, 41 | }; 42 | }; 43 | 44 | #endif // POSIX_QUEUE_H 45 | -------------------------------------------------------------------------------- /src/utils/ucx/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ucx_utils_dep = [ ucx_dep, nixl_common_dep, serdes_interface ] 17 | 18 | if cuda_dep.found() 19 | ucx_utils_dep += [ cuda_dep ] 20 | endif 21 | 22 | ucx_utils_inc_dirs = include_directories('.') 23 | 24 | ucx_utils_sources = ['ucx_utils.cpp', 'ucx_utils.h', 'config.h', 'config.cpp', 'rkey.cpp', 'rkey.h', 'gpu_xfer_req_h.cpp', 'gpu_xfer_req_h.h'] 25 | 26 | ucx_utils_lib = library('ucx_utils', 27 | ucx_utils_sources, 28 | dependencies: ucx_utils_dep, 29 | include_directories: [ nixl_inc_dirs, utils_inc_dirs ], 30 | install: true, 31 | build_rpath: get_option('ucx_path') != '' ? get_option('ucx_path') + '/lib' : '', 32 | install_rpath: get_option('ucx_path') != '' ? get_option('ucx_path') + '/lib' : '') 33 | -------------------------------------------------------------------------------- /src/plugins/hf3fs/hf3fs_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "backend/backend_plugin.h" 19 | #include "hf3fs_backend.h" 20 | #include 21 | 22 | 23 | // Plugin type alias for convenience 24 | using hf3fs_plugin_t = nixlBackendPluginCreator; 25 | 26 | #ifdef STATIC_PLUGIN_HF3FS 27 | nixlBackendPlugin * 28 | createStaticHF3FSPlugin() { 29 | return hf3fs_plugin_t::create( 30 | NIXL_PLUGIN_API_VERSION, "HF3FS", "0.1.0", {}, {FILE_SEG, DRAM_SEG}); 31 | } 32 | #else 33 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 34 | nixl_plugin_init() { 35 | return hf3fs_plugin_t::create( 36 | NIXL_PLUGIN_API_VERSION, "HF3FS", "0.1.0", {}, {FILE_SEG, DRAM_SEG}); 37 | } 38 | 39 | extern "C" NIXL_PLUGIN_EXPORT void 40 | nixl_plugin_fini() {} 41 | #endif 42 | -------------------------------------------------------------------------------- /src/infra/test_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include "test_utils.h" 18 | #include "nixl_types.h" 19 | #include "common/nixl_log.h" 20 | #include 21 | 22 | void 23 | nixl_exit_on_failure(nixl_status_t status, std::string_view message, std::string_view agent) { 24 | if (status == NIXL_SUCCESS) return; 25 | 26 | NIXL_ERROR << message << (agent.empty() ? "" : " for agent " + std::string{agent}) << ": " 27 | << nixlEnumStrings::statusStr(status) << " [" << status << "]"; 28 | exit(EXIT_FAILURE); 29 | } 30 | 31 | void 32 | nixl_exit_on_failure(bool condition, std::string_view message, std::string_view agent) { 33 | if (condition) return; 34 | 35 | NIXL_ERROR << message << (agent.empty() ? "" : " for agent " + std::string{agent}); 36 | exit(EXIT_FAILURE); 37 | } 38 | -------------------------------------------------------------------------------- /test/unit/utils/libfabric/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-FileCopyrightText: Copyright (c) 2025 Amazon.com, Inc. and affiliates. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | libfabric_utils_dep = [ libfabric_dep, nixl_common_deps ] 18 | libfabric_test_cpp_args = [] 19 | 20 | if cuda_dep.found() 21 | libfabric_utils_dep += [ cuda_dep ] 22 | libfabric_test_cpp_args += [ '-DCUDA_FOUND' ] 23 | endif 24 | 25 | if get_option('buildtype') != 'release' 26 | 27 | libfabric_topology_test_bin = executable('libfabric_topology_test', 28 | 'libfabric_topology_test.cpp', 29 | dependencies: libfabric_utils_dep, 30 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 31 | link_with: libfabric_utils_lib, 32 | cpp_args: libfabric_test_cpp_args, 33 | install: true) 34 | 35 | endif 36 | -------------------------------------------------------------------------------- /benchmark/nixlbench/meson_options.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | option('cudapath_inc', type: 'string', value: '', description: 'Include path for CUDA') 17 | option('cudapath_lib', type: 'string', value: '', description: 'Library path for CUDA') 18 | option('cudapath_stub', type: 'string', value: '', description: 'Extra Stub path for CUDA') 19 | option('etcd_inc_path', type: 'string', value: '', description: 'Path to ETCD C++ Client includes') 20 | option('etcd_lib_path', type: 'string', value: '', description: 'Path to ETCD C++ Client library') 21 | option('nixl_path', type: 'string', value: '/usr/local', description: 'Path to NiXL') 22 | option('nvshmem_inc_path', type: 'string', value: '', description: 'Path to NVSHMEM include directory') 23 | option('nvshmem_lib_path', type: 'string', value: '', description: 'Path to NVSHMEM library directory') 24 | -------------------------------------------------------------------------------- /src/bindings/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [package] 17 | name = "nixl-sys" 18 | description = "Low-level bindings to the nixl library" 19 | links = "nixl" 20 | build = "build.rs" 21 | version.workspace = true 22 | edition.workspace = true 23 | authors.workspace = true 24 | homepage.workspace = true 25 | license.workspace = true 26 | repository.workspace = true 27 | readme.workspace = true 28 | 29 | [features] 30 | stub-api = [] 31 | 32 | [dependencies] 33 | thiserror = { version = "2" } 34 | tracing = { version = "0.1" } 35 | serde = { version = "1", features = ["derive"] } 36 | bincode = "1" 37 | libc = "0.2" 38 | 39 | [build-dependencies] 40 | bindgen = "0.71" 41 | cc = { version = "1.2.23", features = ["parallel"] } 42 | pkg-config = "0.3" 43 | os_info = "3.11" 44 | anyhow = "1" 45 | 46 | [dev-dependencies] 47 | tempfile = "3.20.0" 48 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | subdir('api') 17 | 18 | subdir('utils') 19 | 20 | #subdir('arch') 21 | subdir('infra') 22 | subdir('plugins') 23 | subdir('core') 24 | 25 | # Test utilities library - created after nixl_dep is available to avoid circular dependencies 26 | nixl_test_utils_lib = library('nixl_test_utils', 27 | 'infra/test_utils.cpp', 28 | include_directories: [ nixl_inc_dirs, utils_inc_dirs ], 29 | dependencies: [nixl_dep, nixl_common_dep, absl_log_dep], 30 | install: true) 31 | 32 | nixl_test_utils_dep = declare_dependency( 33 | include_directories: include_directories('infra'), 34 | link_with: nixl_test_utils_lib, 35 | dependencies: [nixl_dep, nixl_common_dep] 36 | ) 37 | 38 | subdir('bindings') 39 | -------------------------------------------------------------------------------- /src/bindings/rust/src/descriptors/xfer_dlist_handle.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | // SPDX-License-Identifier: Apache-2.0 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use super::*; 17 | 18 | pub struct XferDlistHandle { 19 | inner: *mut bindings::nixl_capi_xfer_dlist_handle_s, 20 | agent: NonNull 21 | } 22 | 23 | impl XferDlistHandle { 24 | pub fn new(inner: *mut bindings::nixl_capi_xfer_dlist_handle_s, 25 | agent: NonNull) -> Self { 26 | Self { inner, agent } 27 | } 28 | 29 | pub fn handle(&self) -> *mut bindings::nixl_capi_xfer_dlist_handle_s { 30 | self.inner 31 | } 32 | } 33 | 34 | impl Drop for XferDlistHandle { 35 | fn drop(&mut self) { 36 | unsafe { 37 | nixl_capi_release_xfer_dlist_handle(self.agent.as_ptr(), 38 | self.handle()); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/plugins/telemetry/prometheus/prometheus_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "prometheus_exporter.h" 19 | #include "telemetry/telemetry_plugin.h" 20 | #include "telemetry/telemetry_exporter.h" 21 | 22 | // Plugin type alias for convenience 23 | using prometheus_exporter_plugin_t = nixlTelemetryPluginCreator; 24 | 25 | // Plugin initialization function - must be extern "C" for dynamic loading 26 | extern "C" NIXL_TELEMETRY_PLUGIN_EXPORT nixlTelemetryPlugin * 27 | nixl_telemetry_plugin_init() { 28 | return prometheus_exporter_plugin_t::create( 29 | nixlTelemetryPluginApiVersionV1, "prometheus", "1.0.0"); 30 | } 31 | 32 | // Plugin cleanup function 33 | extern "C" NIXL_TELEMETRY_PLUGIN_EXPORT void 34 | nixl_telemetry_plugin_fini() { 35 | // Nothing to clean up for prometheus exporter 36 | } 37 | -------------------------------------------------------------------------------- /src/plugins/gds_mt/gds_mt_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "backend/backend_plugin.h" 19 | #include "gds_mt_backend.h" 20 | #include "common/nixl_log.h" 21 | #include 22 | 23 | 24 | // Plugin type alias for convenience 25 | using gds_mt_plugin_t = nixlBackendPluginCreator; 26 | 27 | #ifdef STATIC_PLUGIN_GDS_MT 28 | nixlBackendPlugin * 29 | createStaticGDS_MTPlugin() { 30 | return gds_mt_plugin_t::create( 31 | NIXL_PLUGIN_API_VERSION, "GDS_MT", "0.1.0", {}, {DRAM_SEG, VRAM_SEG, FILE_SEG}); 32 | } 33 | #else 34 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 35 | nixl_plugin_init() { 36 | return gds_mt_plugin_t::create( 37 | NIXL_PLUGIN_API_VERSION, "GDS_MT", "0.1.0", {}, {DRAM_SEG, VRAM_SEG, FILE_SEG}); 38 | } 39 | 40 | extern "C" NIXL_PLUGIN_EXPORT void 41 | nixl_plugin_fini() {} 42 | #endif 43 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/runtime/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | runtime_sources = [ 17 | 'runtime.cpp', 18 | 'runtime.h', 19 | ] 20 | 21 | # Create a runtime-specific include directory 22 | runtime_inc = include_directories('.') 23 | 24 | # Use the utils_lib directly instead of trying to get it as a dependency 25 | runtime_lib = static_library('runtime', 26 | runtime_sources, 27 | include_directories: [inc_dir, runtime_inc], 28 | install: true, 29 | ) 30 | 31 | nixlbench_runtimes = [runtime_lib] 32 | rt_deps = [] 33 | rt_inc_deps = [] 34 | # Include subdirectories 35 | if etcd_available 36 | subdir('etcd') 37 | nixlbench_runtimes += etcd_rt_lib 38 | rt_deps = etcd_dep 39 | rt_inc_deps += etcd_inc 40 | endif 41 | 42 | runtime_interface = declare_dependency( 43 | link_with: nixlbench_runtimes, 44 | dependencies: rt_deps, 45 | include_directories: [etcd_inc] 46 | ) 47 | -------------------------------------------------------------------------------- /src/plugins/obj/obj_executor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef OBJ_EXECUTOR_H 19 | #define OBJ_EXECUTOR_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | class asioThreadPoolExecutor : public Aws::Utils::Threading::Executor { 26 | public: 27 | explicit asioThreadPoolExecutor(std::size_t num_threads) : pool_(num_threads) {} 28 | 29 | void 30 | WaitUntilStopped() override { 31 | pool_.stop(); 32 | pool_.join(); 33 | } 34 | 35 | void 36 | waitUntilIdle() { 37 | pool_.wait(); 38 | } 39 | 40 | protected: 41 | bool 42 | SubmitToThread(std::function &&task) override { 43 | asio::post(pool_, std::move(task)); 44 | return true; 45 | } 46 | 47 | private: 48 | asio::thread_pool pool_; 49 | }; 50 | 51 | #endif // OBJ_EXECUTOR_H 52 | -------------------------------------------------------------------------------- /contrib/aws-efa/aws_vars.template: -------------------------------------------------------------------------------- 1 | { 2 | "podProperties": { 3 | "containers": [ 4 | { 5 | "command": [ 6 | "/bin/bash", 7 | "-c", 8 | "${AWS_CMD}" 9 | ], 10 | "image": "${CONTAINER_IMAGE}", 11 | "env": [ 12 | { 13 | "name": "UCX_VERSION", 14 | "value": "${UCX_VERSION}" 15 | }, 16 | { 17 | "name": "TEST_LIBFABRIC", 18 | "value": "true" 19 | }, 20 | { 21 | "name": "UCX_INSTALL_DIR", 22 | "value": "/usr/local" 23 | }, 24 | { 25 | "name": "NIXL_INSTALL_DIR", 26 | "value": "/opt/nixl" 27 | }, 28 | { 29 | "name": "LDFLAGS", 30 | "value": "-lpthread -ldl" 31 | }, 32 | { 33 | "name": "LD_LIBRARY_PATH", 34 | "value": "/opt/nixl/lib:/opt/nixl/lib/x86_64-linux-gnu:/opt/nixl/lib/x86_64-linux-gnu/plugins:/usr/local/lib" 35 | }, 36 | { 37 | "name": "NIXL_PLUGIN_DIR", 38 | "value": "/opt/nixl/lib/x86_64-linux-gnu/plugins" 39 | } 40 | ] 41 | } 42 | ] 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/plugins/libfabric/libfabric_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-FileCopyrightText: Copyright (c) 2025 Amazon.com, Inc. and affiliates. 4 | * SPDX-License-Identifier: Apache-2.0 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include "backend/backend_plugin.h" 20 | #include "libfabric_backend.h" 21 | 22 | // Plugin type alias for convenience 23 | using libfabric_plugin_t = nixlBackendPluginCreator; 24 | 25 | #ifdef STATIC_PLUGIN_LIBFABRIC 26 | nixlBackendPlugin * 27 | createStaticLIBFABRICPlugin() { 28 | return libfabric_plugin_t::create( 29 | NIXL_PLUGIN_API_VERSION, "LIBFABRIC", "0.1.0", {}, {DRAM_SEG, VRAM_SEG}); 30 | } 31 | #else 32 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 33 | nixl_plugin_init() { 34 | return libfabric_plugin_t::create( 35 | NIXL_PLUGIN_API_VERSION, "LIBFABRIC", "0.1.0", {}, {DRAM_SEG, VRAM_SEG}); 36 | } 37 | 38 | extern "C" NIXL_PLUGIN_EXPORT void 39 | nixl_plugin_fini() {} 40 | #endif 41 | -------------------------------------------------------------------------------- /test/gtest/plugins/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | if enabled_plugins.get('UCCL') 17 | subdir('uccl') 18 | endif 19 | 20 | if not enabled_plugins.get('OBJ') 21 | message('OBJ plugin not enabled, skipping plugins_gtest build') 22 | subdir_done() 23 | endif 24 | 25 | aws_s3 = dependency('aws-cpp-sdk-s3', static: false, required: false) 26 | if not aws_s3.found() 27 | message('aws-cpp-sdk-s3 not found, skipping plugins_gtest build') 28 | subdir_done() 29 | endif 30 | 31 | plugins_test_exe = executable('plugins_gtest', 32 | sources : ['../main.cpp', '../common.cpp', 'obj_plugin.cpp'], 33 | include_directories: [nixl_inc_dirs, utils_inc_dirs, plugins_inc_dirs, '.'], 34 | dependencies : [nixl_dep, gtest_dep, absl_strings_dep, absl_time_dep, plugin_deps, 35 | obj_backend_interface], 36 | link_with: [nixl_build_lib], 37 | install : true 38 | ) 39 | 40 | test('plugins_gtest', plugins_test_exe) 41 | -------------------------------------------------------------------------------- /.github/workflows/mirror_repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # Description: This script triggers a GitLab mirror update and waits for completion 3 | # Usage: ./update_gitlab_mirror.sh 4 | 5 | GITLAB_ACCESS_TOKEN=$1 6 | GITLAB_MIRROR_URL=$2 7 | 8 | SYNC_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 9 | curl --fail-with-body --request POST --header "PRIVATE-TOKEN: ${GITLAB_ACCESS_TOKEN}" "${GITLAB_MIRROR_URL}" 10 | 11 | echo "Mirror update request submitted at ${SYNC_TIME}" 12 | 13 | # Poll for completion 14 | # GitLab limits the frequency of mirror updates to once every 5 mins. 15 | # If you trigger an update more frequently, it may not start immediately. 16 | # Make sure sync is finished after sync request was submitted 17 | MAX_RETRIES=15 18 | RETRY_INTERVAL=30 19 | # Convert timestamps to epoch for comparison, timezone agnostic 20 | SYNC_TIME_SECONDS=$(date -d "$SYNC_TIME" +%s) 21 | for i in $(seq 1 $MAX_RETRIES); do 22 | MIRROR_INFO=$(curl --silent --header "PRIVATE-TOKEN: ${GITLAB_ACCESS_TOKEN}" "${GITLAB_MIRROR_URL}") 23 | MIRROR_STATUS=$(echo "$MIRROR_INFO" | jq -r '.update_status') 24 | LAST_UPDATE=$(echo "$MIRROR_INFO" | jq -r '.last_update_at') 25 | LAST_UPDATE_SECONDS=$(date -d "$LAST_UPDATE" +%s) 26 | if [ "$MIRROR_STATUS" = "finished" ] && [ $LAST_UPDATE_SECONDS -gt $SYNC_TIME_SECONDS ]; then 27 | echo "Mirror sync successful. Last update: $LAST_UPDATE" 28 | exit 0 29 | fi 30 | echo "Waiting for mirror sync to complete. Attempt $i of $MAX_RETRIES" 31 | echo "Last update: $LAST_UPDATE" 32 | sleep $RETRY_INTERVAL 33 | done 34 | echo "Mirror sync failed or timed out" 35 | exit 1 36 | -------------------------------------------------------------------------------- /src/utils/common/nixl_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef _NIXL_TIME_H 18 | #define _NIXL_TIME_H 19 | 20 | #include 21 | 22 | namespace nixlTime { 23 | 24 | using namespace std::chrono; 25 | 26 | using ns_t = uint64_t; 27 | using us_t = uint64_t; 28 | using ms_t = uint64_t; 29 | using sec_t = uint64_t; 30 | 31 | static inline ns_t getNs() { 32 | return duration_cast(steady_clock::now().time_since_epoch()).count(); 33 | } 34 | 35 | static inline us_t getUs() { 36 | return duration_cast(steady_clock::now().time_since_epoch()).count(); 37 | } 38 | 39 | static inline ms_t getMs() { 40 | return duration_cast(steady_clock::now().time_since_epoch()).count(); 41 | } 42 | 43 | static inline sec_t getSec() { 44 | return duration_cast(steady_clock::now().time_since_epoch()).count(); 45 | } 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/runtime/etcd/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | import pybind11 18 | from pybind11.setup_helpers import Pybind11Extension, build_ext 19 | from setuptools import setup 20 | 21 | # Define the extension module 22 | ext_modules = [ 23 | Pybind11Extension( 24 | "etcd_runtime", 25 | [ 26 | "python_bindings.cpp", 27 | "etcd_rt.cpp", 28 | ], 29 | include_dirs=[ 30 | # Path to pybind11 headers 31 | pybind11.get_include(), 32 | # Path to the parent directory (for runtime.h) 33 | "..", 34 | # Path to current directory 35 | ".", 36 | ], 37 | libraries=["etcd-cpp-api"], 38 | language="c++", 39 | ), 40 | ] 41 | 42 | setup( 43 | name="etcd_runtime", 44 | ext_modules=ext_modules, 45 | cmdclass={"build_ext": build_ext}, 46 | zip_safe=False, 47 | python_requires=">=3.6", 48 | ) 49 | -------------------------------------------------------------------------------- /examples/cpp/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | nixl_example = executable('nixl_example', 17 | 'nixl_example.cpp', 18 | dependencies: [nixl_dep, nixl_infra, nixl_common_deps, nixl_test_utils_dep], 19 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 20 | link_with: [serdes_lib], 21 | install: true) 22 | 23 | if etcd_dep.found() 24 | etcd_example = executable('nixl_etcd_example', 25 | 'nixl_etcd_example.cpp', 26 | dependencies: [nixl_dep, nixl_infra, nixl_common_deps, nixl_test_utils_dep], 27 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 28 | link_with: [serdes_lib], 29 | install: true) 30 | endif 31 | 32 | telemetry_reader = executable('telemetry_reader', 33 | 'telemetry_reader.cpp', 34 | dependencies: [nixl_dep, nixl_common_deps], 35 | include_directories: [nixl_inc_dirs, utils_inc_dirs], 36 | install: true) 37 | -------------------------------------------------------------------------------- /test/gtest/mocks/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | gtest_inc_dirs = include_directories('..') 17 | 18 | mock_backend_sources = ['gmock_engine.cpp', 'mock_backend_plugin.cpp', 'mock_backend_engine.cpp'] 19 | mock_backend_plugin = shared_library('MOCK_BACKEND', mock_backend_sources, 20 | dependencies: [nixl_infra, nixl_common_dep, gmock_dep], 21 | include_directories: [nixl_inc_dirs, utils_inc_dirs, gtest_inc_dirs], 22 | link_with : [ucx_backend_lib], 23 | name_prefix: 'libplugin_', 24 | install: true, 25 | install_dir: plugin_install_dir) 26 | run_command('sh', '-c', 27 | 'echo "MOCK_BACKEND=' + mock_backend_plugin.full_path() + '" >> ' + plugin_build_dir + '/pluginlist', 28 | check: true 29 | ) 30 | 31 | source_root = meson.project_source_root() 32 | mocks_dep = declare_dependency(variables : {'path' : meson.current_source_dir().split(source_root + '/')[1]}) 33 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/runtime/runtime.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "runtime/runtime.h" 19 | 20 | int xferBenchRT::getSize() const { 21 | return size; 22 | } 23 | 24 | int xferBenchRT::getRank() const { 25 | return rank; 26 | } 27 | 28 | 29 | int xferBenchRT::sendInt(int *buffer, int dest_rank) { 30 | return 0; 31 | } 32 | 33 | int xferBenchRT::recvInt(int *buffer, int src_rank) { 34 | return 0; 35 | } 36 | 37 | int xferBenchRT::broadcastInt(int *buffer, size_t count, int root_rank) { 38 | return 0; 39 | } 40 | 41 | int xferBenchRT::sendChar(char *buffer, size_t count, int dest_rank) { 42 | return 0; 43 | } 44 | 45 | int xferBenchRT::recvChar(char *buffer, size_t count, int src_rank) { 46 | return 0; 47 | } 48 | 49 | int xferBenchRT::reduceSumDouble(double *local_buffer, double *global_buffer, int dest_rank) { 50 | return 0; 51 | } 52 | 53 | int xferBenchRT::barrier(const std::string& barrier_id) { 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /test/gtest/plugins/plugins_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef __PLUGIN_TEST_H 18 | #define __PLUGIN_TEST_H 19 | 20 | #include 21 | #include 22 | #include "backend_engine.h" 23 | 24 | namespace gtest::plugins { 25 | /* 26 | * Base class for all plugin tests. 27 | */ 28 | class setupBackendTestFixture : public testing::TestWithParam { 29 | protected: 30 | std::shared_ptr localBackendEngine_; 31 | std::shared_ptr remoteBackendEngine_; 32 | 33 | void 34 | SetUp() { 35 | ASSERT_FALSE(localBackendEngine_->getInitErr()) 36 | << "Failed to initialize local backend engine"; 37 | if (remoteBackendEngine_) { 38 | ASSERT_FALSE(remoteBackendEngine_->getInitErr()) 39 | << "Failed to initialize remote backend engine"; 40 | } 41 | } 42 | }; 43 | 44 | } // namespace gtest::plugins 45 | #endif // __PLUGIN_TEST_H 46 | -------------------------------------------------------------------------------- /.clang-tidy: -------------------------------------------------------------------------------- 1 | Checks: '-*,readability-identifier-naming' 2 | CheckOptions: 3 | # Local variables and function arguments 4 | - { key: readability-identifier-naming.LocalVariableCase, value: lower_case } 5 | - { key: readability-identifier-naming.ParameterCase, value: lower_case } 6 | # Class, struct, union, and enum type names 7 | - { key: readability-identifier-naming.ClassCase, value: camelBack } 8 | - { key: readability-identifier-naming.StructCase, value: camelBack } 9 | - { key: readability-identifier-naming.UnionCase, value: camelBack } 10 | - { key: readability-identifier-naming.EnumCase, value: lower_case } 11 | # Fields and methods for classes, structs, and unions 12 | - { key: readability-identifier-naming.ClassMemberCase, value: camelBack } 13 | - { key: readability-identifier-naming.StructMemberCase, value: camelBack } 14 | - { key: readability-identifier-naming.UnionMemberCase, value: camelBack } 15 | - { key: readability-identifier-naming.MethodCase, value: camelBack } 16 | # Private class members (fields) 17 | - { key: readability-identifier-naming.PrivateMemberCase, value: camelBack } 18 | - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ } 19 | # Enum values (enumerators) 20 | - { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE } 21 | # For 'using' type aliases 22 | - { key: readability-identifier-naming.TypeAliasCase, value: lower_case } 23 | - { key: readability-identifier-naming.TypeAliasSuffix, value: _t } 24 | # For 'typedef' type aliases 25 | - { key: readability-identifier-naming.TypedefCase, value: lower_case } 26 | - { key: readability-identifier-naming.TypedefSuffix, value: _t } 27 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Report a Security Vulnerability 19 | 20 | To report a potential security vulnerability in any NVIDIA product, please use either: 21 | * This web form: [Security Vulnerability Submission Form](https://www.nvidia.com/en-us/support/submit-security-vulnerability/), or 22 | * Send email to: [NVIDIA PSIRT](mailto:psirt@nvidia.com) 23 | 24 | If reporting a potential vulnerability via email, please encrypt it using NVIDIA’s public PGP key ([see PGP Key page](https://www.nvidia.com/en-us/security/pgp-key/)) and include the following information: 25 | 1. Product/Driver name and version/branch that contains the vulnerability 26 | 2. Type of vulnerability (code execution, denial of service, buffer overflow, etc.) 27 | 3. Instructions to reproduce the vulnerability 28 | 4. Proof-of-concept or exploit code 29 | 5. Potential impact of the vulnerability, including how an attacker could exploit the vulnerability 30 | 31 | See https://www.nvidia.com/en-us/security/ for past NVIDIA Security Bulletins and Notices. 32 | -------------------------------------------------------------------------------- /src/plugins/uccl/uccl_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "backend/backend_plugin.h" 19 | #include "uccl_backend.h" 20 | 21 | namespace { 22 | nixl_b_params_t 23 | get_uccl_options() { 24 | nixl_b_params_t params; 25 | params["in_python"] = ""; 26 | params["num_cpus"] = ""; 27 | return params; 28 | } 29 | } // namespace 30 | 31 | // Plugin type alias for convenience 32 | using uccl_plugin_t = nixlBackendPluginCreator; 33 | 34 | #ifdef STATIC_PLUGIN_UCCL 35 | nixlBackendPlugin * 36 | createStaticUCCLPlugin() { 37 | return uccl_plugin_t::create( 38 | NIXL_PLUGIN_API_VERSION, "UCCL", "0.1.0", get_uccl_options(), {DRAM_SEG, VRAM_SEG}); 39 | } 40 | #else 41 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 42 | nixl_plugin_init() { 43 | return uccl_plugin_t::create( 44 | NIXL_PLUGIN_API_VERSION, "UCCL", "0.1.0", get_uccl_options(), {DRAM_SEG, VRAM_SEG}); 45 | } 46 | 47 | extern "C" NIXL_PLUGIN_EXPORT void 48 | nixl_plugin_fini() {} 49 | #endif 50 | -------------------------------------------------------------------------------- /src/plugins/mooncake/mooncake_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "backend/backend_plugin.h" 19 | #include "mooncake_backend.h" 20 | 21 | namespace { 22 | nixl_b_params_t 23 | get_mooncake_options() { 24 | nixl_b_params_t params; 25 | params["mooncake_devices"] = ""; 26 | return params; 27 | } 28 | } // namespace 29 | 30 | // Plugin type alias for convenience 31 | using mooncake_plugin_t = nixlBackendPluginCreator; 32 | 33 | #ifdef STATIC_PLUGIN_MOONCAKE 34 | nixlBackendPlugin * 35 | createStaticMOONCAKEPlugin() { 36 | return mooncake_plugin_t::create( 37 | NIXL_PLUGIN_API_VERSION, "MOONCAKE", "0.1.0", get_mooncake_options(), {DRAM_SEG, VRAM_SEG}); 38 | } 39 | #else 40 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 41 | nixl_plugin_init() { 42 | return mooncake_plugin_t::create( 43 | NIXL_PLUGIN_API_VERSION, "MOONCAKE", "0.1.0", get_mooncake_options(), {DRAM_SEG, VRAM_SEG}); 44 | } 45 | 46 | extern "C" NIXL_PLUGIN_EXPORT void 47 | nixl_plugin_fini() {} 48 | #endif 49 | -------------------------------------------------------------------------------- /test/unit/plugins/gpunetio/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | compile_flags = [] 17 | 18 | if cuda_dep.found() 19 | cuda_dependencies = [cuda_dep] 20 | compile_flags += '-DHAVE_CUDA' 21 | nvtx_dep = nvcc.find_library('nvToolsExt', dirs: '/usr/local/cuda/lib64', required: false) 22 | dl_dep = dependency('dl', required: true) 23 | 24 | nixl_gpunetio_stream_app = executable ('nixl_gpunetio_stream_test', 'nixl_gpunetio_stream_test.cu', 25 | dependencies: [nixl_dep, nixl_infra, stream_interface] + cuda_dep + dl_dep + nixl_test_utils_dep, 26 | include_directories: [nixl_inc_dirs, utils_inc_dirs, '../../../../src/utils/serdes'], 27 | cpp_args: compile_flags, 28 | cuda_args: compile_flags, 29 | link_with: [serdes_lib], 30 | install: true) 31 | endif 32 | -------------------------------------------------------------------------------- /docs/python_api.md: -------------------------------------------------------------------------------- 1 | # NIXL Python API 2 | 3 | The Python API can be found at `src/api/python/_api.py`. These are the pythonic APIs for NIXL, if more direct access to C++ style methods are desired, 4 | the exact header implementation of `src/api/cpp` is done through pybind11 that can be found in `src/bindings/python`. 5 | 6 | ## Python API Features 7 | 8 | The Python bindings provide access to the full NIXL API including: 9 | 10 | - **Agent Management**: Create and configure NIXL agents 11 | - **Memory Registration**: Register and deregister memory/storage 12 | - **Transfer Operations**: Create and manage data transfers 13 | - **QueryMem API**: Query memory/storage information and accessibility 14 | - **Backend Management**: Create and configure different backends (UCX, GDS, etc.) 15 | 16 | ## Installation 17 | 18 | ### From PyPI 19 | 20 | The nixl python API and libraries, including UCX, are available directly through PyPI: 21 | 22 | ```bash 23 | pip install nixl 24 | ``` 25 | 26 | ### From Source 27 | 28 | To build from source, follow the main build instructions in the README.md, then install the Python bindings: 29 | 30 | ```bash 31 | # From the root nixl directory 32 | pip install . 33 | ``` 34 | 35 | ## Examples 36 | 37 | See the [Python examples](../examples/python/) directory for complete working examples including: 38 | 39 | - [query_mem_example.py](../examples/python/query_mem_example.py) - QueryMem API demonstration 40 | - [nixl_gds_example.py](../examples/python/nixl_gds_example.py) - GDS backend usage 41 | - [nixl_api_example.py](../examples/python/nixl_api_example.py) - General API usage 42 | - [basic_two_peers.py](../examples/python/basic_two_peers.py) - Basic transfer operations 43 | - [partial_md_example.py](../examples/python/partial_md_example.py) - Partial metadata handling 44 | -------------------------------------------------------------------------------- /src/plugins/ucx/ucx_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "backend/backend_plugin.h" 19 | #include "ucx_backend.h" 20 | 21 | // Plugin type alias for convenience 22 | using ucx_plugin_t = nixlBackendPluginCreator; 23 | 24 | #ifdef STATIC_PLUGIN_UCX 25 | nixlBackendPlugin * 26 | createStaticUCXPlugin() { 27 | return ucx_plugin_t::create(NIXL_PLUGIN_API_VERSION, 28 | "UCX", 29 | "0.1.0", 30 | get_ucx_backend_common_options(), 31 | {DRAM_SEG, VRAM_SEG}); 32 | } 33 | #else 34 | extern "C" NIXL_PLUGIN_EXPORT nixlBackendPlugin * 35 | nixl_plugin_init() { 36 | return ucx_plugin_t::create(NIXL_PLUGIN_API_VERSION, 37 | "UCX", 38 | "0.1.0", 39 | get_ucx_backend_common_options(), 40 | {DRAM_SEG, VRAM_SEG}); 41 | } 42 | 43 | extern "C" NIXL_PLUGIN_EXPORT void 44 | nixl_plugin_fini() {} 45 | #endif 46 | -------------------------------------------------------------------------------- /src/bindings/python/nixl_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include 18 | 19 | namespace py = pybind11; 20 | 21 | // NB: for storage IO with O_DIRECT, allocated memory must match device block size 22 | #define IO_SIZE 4096 23 | 24 | //JUST FOR TESTING 25 | uintptr_t malloc_passthru(int size) { 26 | return (uintptr_t)aligned_alloc(IO_SIZE, size); 27 | } 28 | 29 | //JUST FOR TESTING 30 | void free_passthru(uintptr_t buf) { 31 | free((void*) buf); 32 | } 33 | 34 | //JUST FOR TESTING 35 | void ba_buf(uintptr_t addr, int size) { 36 | uint8_t* buf = (uint8_t*) addr; 37 | for(int i = 0; i 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include "nixl_types.h" 26 | 27 | /** 28 | * @brief File utilities for NIXL file backends 29 | */ 30 | 31 | namespace nixl { 32 | 33 | /** 34 | * @brief Query file information for a single file 35 | * @param filename The filename to query (can be prefixed) 36 | * @return nixl_query_resp_t containing file info if accessible, std::nullopt otherwise 37 | */ 38 | nixl_query_resp_t 39 | queryFileInfo(std::string_view filename); 40 | 41 | /** 42 | * @brief Query file information for multiple files 43 | * @param filenames Vector of filenames to query (can be prefixed) 44 | * @param resp Output response vector 45 | * @return NIXL_SUCCESS on success, error code otherwise 46 | */ 47 | nixl_status_t 48 | queryFileInfoList(const std::vector &filenames, std::vector &resp); 49 | 50 | } // namespace nixl 51 | 52 | #endif // __FILE_UTILS_H 53 | -------------------------------------------------------------------------------- /test/gtest/mocks/mock_basic_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include "backend/backend_engine.h" 18 | #include "backend/backend_plugin.h" 19 | #include "common.h" 20 | 21 | namespace mocks { 22 | namespace basic_plugin { 23 | 24 | static nixlBackendEngine *create_engine(const nixlBackendInitParams *) { 25 | return nullptr; 26 | } 27 | 28 | static void destroy_engine(nixlBackendEngine *) {} 29 | 30 | static const char * 31 | get_plugin_name() { 32 | return gtest::mock_basic_plugin_name; 33 | } 34 | 35 | static const char * 36 | get_plugin_version() { 37 | return "0.0.1"; 38 | } 39 | 40 | static nixl_b_params_t get_backend_options() { return nixl_b_params_t(); } 41 | 42 | static nixlBackendPlugin plugin = { 43 | NIXL_PLUGIN_API_VERSION, 44 | create_engine, 45 | destroy_engine, 46 | get_plugin_name, 47 | get_plugin_version, 48 | get_backend_options 49 | }; 50 | } // namespace basic_plugin 51 | 52 | } // namespace mocks 53 | 54 | extern "C" nixlBackendPlugin *nixl_plugin_init() { 55 | return &mocks::basic_plugin::plugin; 56 | } 57 | 58 | extern "C" void nixl_plugin_fini() {} 59 | -------------------------------------------------------------------------------- /src/utils/ucx/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef NIXL_SRC_UTILS_UCX_CONFIG_H 19 | #define NIXL_SRC_UTILS_UCX_CONFIG_H 20 | 21 | #include 22 | #include 23 | 24 | extern "C" { 25 | #include 26 | } 27 | 28 | namespace nixl::ucx { 29 | class config { 30 | public: 31 | config() = default; 32 | 33 | [[nodiscard]] ucp_config_t * 34 | getUcpConfig() const noexcept { 35 | return config_.get(); 36 | } 37 | 38 | // Modify the config if it is not already set via environment variable 39 | void 40 | modify (std::string_view key, std::string_view value) const; 41 | 42 | // Modify the config always 43 | void 44 | modifyAlways (std::string_view key, std::string_view value) const; 45 | 46 | private: 47 | [[nodiscard]] static ucp_config_t * 48 | readUcpConfig(); 49 | 50 | const std::unique_ptr config_{readUcpConfig(), 51 | &ucp_config_release}; 52 | }; 53 | } // namespace nixl::ucx 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/bindings/python/nixl-meta/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | fs = import('fs') 17 | 18 | build_dir = meson.current_build_dir() 19 | 20 | pyproject_toml = configure_file( 21 | input: 'pyproject.toml.in', 22 | output: 'pyproject.toml', 23 | configuration: { 'VERSION': meson.project_version(), 'WHEEL_DEP': cuda_wheel_dir.replace('_', '-') } 24 | ) 25 | 26 | readme_md = fs.copyfile('README.md') 27 | 28 | source_root = meson.project_source_root() 29 | root_license_path = join_paths(source_root, 'LICENSE') 30 | license_path = fs.copyfile(root_license_path) 31 | 32 | nixl_sources = files('nixl/__init__.py') 33 | 34 | subdir('nixl') 35 | 36 | uv = find_program('uv', required: false) 37 | if uv.found() 38 | wheel_name = 'nixl-@0@-py3-none-any.whl'.format(meson.project_version()) 39 | meta_wheel = custom_target( 40 | 'build_nixl_meta', 41 | input: [pyproject_toml, readme_md, license_path] + nixl_sources, 42 | output: [wheel_name], 43 | command: [uv, 'build', '--wheel', '--out-dir', build_dir, build_dir], 44 | install: false, 45 | build_by_default: true 46 | ) 47 | else 48 | warning('uv not found, skipping meta package build') 49 | endif 50 | -------------------------------------------------------------------------------- /src/bindings/rust/src/descriptors/sync_manager.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //! Synchronization manager for frontend-backend data consistency 5 | 6 | use std::cell::Cell; 7 | 8 | /// Trait for types that can synchronize their state to a backend 9 | pub trait BackendSyncable { 10 | type Backend; 11 | type Error; 12 | fn sync_to_backend(&self, backend: &Self::Backend) -> Result<(), Self::Error>; 13 | } 14 | 15 | /// Manager that enforces correct synchronization between frontend and backend 16 | pub struct SyncManager { 17 | data: T, 18 | backend: T::Backend, 19 | dirty: Cell, 20 | } 21 | 22 | impl SyncManager { 23 | /// Creates a new sync manager (starts dirty to ensure first sync) 24 | pub fn new(data: T, backend: T::Backend) -> Self { 25 | Self { 26 | data, 27 | backend, 28 | dirty: Cell::new(true), 29 | } 30 | } 31 | 32 | /// Provides mutable access to the frontend data 33 | pub fn data_mut(&mut self) -> &mut T { 34 | self.dirty.set(true); 35 | &mut self.data 36 | } 37 | 38 | /// Provides read-only access to the frontend data (no sync) 39 | pub fn data(&self) -> &T { 40 | &self.data 41 | } 42 | 43 | /// Provides read-only access to the backend after ensuring synchronization 44 | pub fn backend(&self) -> Result<&T::Backend, T::Error> { 45 | self.ensure_synced()?; 46 | Ok(&self.backend) 47 | } 48 | 49 | fn ensure_synced(&self) -> Result<(), T::Error> { 50 | if self.dirty.get() { 51 | self.data.sync_to_backend(&self.backend)?; 52 | self.dirty.set(false); 53 | } 54 | Ok(()) 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /.gitlab/test_plugins.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # shellcheck disable=SC1091 18 | . "$(dirname "$0")/../.ci/scripts/common.sh" 19 | 20 | set -e 21 | set -x 22 | 23 | # Parse commandline arguments with first argument being the install directory. 24 | INSTALL_DIR=$1 25 | 26 | if [ -z "$INSTALL_DIR" ]; then 27 | echo "Usage: $0 " 28 | exit 1 29 | fi 30 | 31 | ARCH=$(uname -m) 32 | [ "$ARCH" = "arm64" ] && ARCH="aarch64" 33 | 34 | export LD_LIBRARY_PATH=${INSTALL_DIR}/lib:${INSTALL_DIR}/lib/$ARCH-linux-gnu:${INSTALL_DIR}/lib/$ARCH-linux-gnu/plugins:/usr/local/lib:$LD_LIBRARY_PATH 35 | 36 | export CPATH=${INSTALL_DIR}/include:$CPATH 37 | export PATH=${INSTALL_DIR}/bin:$PATH 38 | export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH 39 | export NIXL_PLUGIN_DIR=${INSTALL_DIR}/lib/$ARCH-linux-gnu/plugins 40 | 41 | echo "==== Show system info ====" 42 | env 43 | nvidia-smi topo -m || true 44 | ibv_devinfo || true 45 | uname -a || true 46 | 47 | echo "==== Running Plugins Gtest tests ====" 48 | cd ${INSTALL_DIR} 49 | # shellcheck disable=SC2154 50 | ./bin/plugins_gtest --min-tcp-port="$min_gtest_port" --max-tcp-port="$max_gtest_port" 51 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # Test Descriptions 2 | 3 | Here are all the explained tests in this directory. There are more specific unit tests in unit/plugins and unit/utils. 4 | 5 | - test/agent_example.cpp - Single threaded test of the nixlAgent API 6 | - test/desc_example.cpp - Test of nixl descriptors and DescList 7 | - test/metadata_streamer.cpp - Single or Multi node test of nixl metadata streamer 8 | - test/nixl_test.cpp - Single or Multi node test of nixlAgent API 9 | - test/ucx_backend_test.cpp - Single threaded test of all the ucxBackendEngine functionality 10 | - test/ucx_backend_multi.cpp - Multi threaded test of UCX connection setup/teardown 11 | - test/python/nixl_bindings_test.py - single threaded Python test of nixlAgent, nixlBasicDesc, and nixlDescList python bindings 12 | 13 | ## Google Test Framework (gtest) 14 | 15 | The project includes comprehensive unit tests using Google Test framework located in `test/gtest/`: 16 | 17 | - test/gtest/telemetry_test.cpp - Comprehensive tests for NIXL telemetry functionality including initialization, data tracking, thread safety, and edge cases 18 | - test/gtest/query_mem.cpp - Tests for memory query functionality 19 | - test/gtest/error_handling.cpp - Tests for error handling and status codes 20 | - test/gtest/test_transfer.cpp - Tests for data transfer operations 21 | - test/gtest/plugin_manager.cpp - Tests for plugin management 22 | - test/gtest/multi_threading.cpp - Multi-threaded test scenarios 23 | - test/gtest/metadata_exchange.cpp - Tests for metadata exchange functionality 24 | 25 | To run the gtest suite: 26 | ```bash 27 | # Build the project 28 | meson setup build 29 | meson compile -C build 30 | 31 | # Run all tests 32 | cd build 33 | ./gtest 34 | 35 | # Run specific test categories 36 | ./gtest --gtest_filter="TelemetryTest*" # Run only telemetry tests 37 | ./gtest --gtest_filter="QueryMemTest*" # Run only query memory tests 38 | ``` 39 | -------------------------------------------------------------------------------- /src/core/telemetry/buffer_exporter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include "buffer_exporter.h" 18 | #include "common/nixl_log.h" 19 | 20 | namespace { 21 | static std::filesystem::path 22 | getFilePath(const nixlTelemetryExporterInitParams &init_params) { 23 | // if we reach here, we ensured env var is set 24 | auto telemetry_dir = std::getenv(telemetryDirVar); 25 | return std::filesystem::path(telemetry_dir) / init_params.agentName.data(); 26 | } 27 | } // namespace 28 | 29 | nixlTelemetryBufferExporter::nixlTelemetryBufferExporter( 30 | const nixlTelemetryExporterInitParams &init_params) 31 | : nixlTelemetryExporter(init_params), 32 | filePath_(getFilePath(init_params)), 33 | buffer_(filePath_.string(), true, TELEMETRY_VERSION, getMaxEventsBuffered()) { 34 | NIXL_INFO << "Telemetry enabled, using buffer path: " << filePath_.string() 35 | << " with size: " << getMaxEventsBuffered(); 36 | } 37 | 38 | nixl_status_t 39 | nixlTelemetryBufferExporter::exportEvent(const nixlTelemetryEvent &event) { 40 | if (!buffer_.push(event)) { 41 | return NIXL_ERR_UNKNOWN; 42 | } 43 | 44 | return NIXL_SUCCESS; 45 | } 46 | -------------------------------------------------------------------------------- /test/unit/plugins/ucx/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ucx_backend_dep = declare_dependency(link_with: ucx_backend_lib, include_directories: [nixl_inc_dirs, '../../../../src/plugins/ucx']) 17 | 18 | if cuda_dep.found() 19 | cuda_dependencies = [cuda_dep] 20 | cpp_args = '-DHAVE_CUDA' 21 | else 22 | cuda_dependencies = [] 23 | cpp_args = '-UHAVE_CUDA' 24 | endif 25 | 26 | ucx_backend_test = executable('ucx_backend_test', 27 | 'ucx_backend_test.cpp', 28 | dependencies: [nixl_dep, nixl_infra, nixl_common_deps, ucx_backend_dep, ucx_dep, thread_dep] + cuda_dependencies + nixl_test_utils_dep, 29 | include_directories: [nixl_inc_dirs, utils_inc_dirs, '../../../../src/plugins/ucx'], 30 | cpp_args : cpp_args, 31 | install: true) 32 | 33 | ucx_backend_multi = executable('ucx_backend_multi', 34 | 'ucx_backend_multi.cpp', 35 | dependencies: [nixl_dep, nixl_infra, nixl_common_deps, ucx_backend_dep, ucx_dep, thread_dep] + cuda_dependencies + nixl_test_utils_dep, 36 | include_directories: [nixl_inc_dirs, utils_inc_dirs, '../../../../src/plugins/ucx'], 37 | cpp_args : cpp_args, 38 | install: true) 39 | -------------------------------------------------------------------------------- /test/unit/utils/stream/metadata_streamer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include "stream/metadata_stream.h" 18 | #include 19 | #include 20 | #include 21 | 22 | void run_server() { 23 | nixlMDStreamListener listener(8082); 24 | listener.startListenerForClients(); 25 | return; 26 | } 27 | 28 | void run_client() { 29 | nixlMDStreamClient client("127.0.0.1", 8082); 30 | client.connectListener(); 31 | std::string data = "Hello NixL MD listener\n"; 32 | client.sendData(data); 33 | std::cout << "Sent Data to listener " << data << "\n"; 34 | std::string ack = client.recvData(); 35 | std::cout << "Received from server: " << ack << "\n"; 36 | 37 | return; 38 | } 39 | 40 | int main (int argc, char *argv[]) { 41 | if (argc < 2) { 42 | std::cout << "Enter client/server\n"; 43 | exit(-1); 44 | } 45 | 46 | std::string arg1 = argv[1]; 47 | std::string server = "server"; 48 | std::transform(arg1.begin(), arg1.end(), arg1.begin(), ::tolower); 49 | 50 | if (arg1 == server) 51 | run_server(); 52 | else 53 | run_client(); 54 | 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /src/bindings/python/nixl-meta/nixl/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import importlib 17 | import sys 18 | 19 | # Try packages in order 20 | candidates = ["nixl_cu13", "nixl_cu12"] 21 | _pkg = None 22 | for pkg in candidates: 23 | try: 24 | _pkg = importlib.import_module(pkg) 25 | break 26 | except ModuleNotFoundError: 27 | continue 28 | 29 | if _pkg is None: 30 | raise ImportError( 31 | "Could not find CUDA-specific NIXL package. Please install NIXL with `pip install nixl[cu12]` or `pip install nixl[cu13]`" 32 | ) 33 | 34 | submodules = ["_api", "_bindings", "_utils", "logging"] 35 | for sub_name in submodules: 36 | # Import submodule from actual wheel 37 | module = importlib.import_module(f"{pkg}.{sub_name}") 38 | # Make it accessible as nixl._api, nixl._utils, nixl.logging 39 | sys.modules[f"nixl.{sub_name}"] = module 40 | # Also add the submodule itself to the nixl namespace 41 | setattr(sys.modules[__name__], sub_name, module) 42 | 43 | # Expose all symbols from the submodule under the nixl namespace 44 | for attr in dir(module): 45 | if not attr.startswith("_"): 46 | setattr(sys.modules[__name__], attr, getattr(module, attr)) 47 | -------------------------------------------------------------------------------- /src/utils/serdes/serdes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef __SERDES_H 18 | #define __SERDES_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "nixl_types.h" 25 | 26 | class nixlSerDes { 27 | private: 28 | typedef enum { SERIALIZE, DESERIALIZE } ser_mode_t; 29 | 30 | std::string workingStr; 31 | ssize_t des_offset; 32 | ser_mode_t mode; 33 | 34 | public: 35 | nixlSerDes(); 36 | 37 | /* Ser/Des for Strings */ 38 | nixl_status_t addStr(const std::string &tag, const std::string &str); 39 | std::string getStr(const std::string &tag); 40 | 41 | /* Ser/Des for Byte buffers */ 42 | nixl_status_t addBuf(const std::string &tag, const void* buf, ssize_t len); 43 | ssize_t getBufLen(const std::string &tag) const; 44 | nixl_status_t getBuf(const std::string &tag, void *buf, ssize_t len); 45 | 46 | /* Ser/Des buffer management */ 47 | std::string exportStr() const; 48 | nixl_status_t importStr(const std::string &sdbuf); 49 | 50 | static std::string _bytesToString(const void *buf, ssize_t size); 51 | static void _stringToBytes(void* fill_buf, const std::string &s, ssize_t size); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /test/unit/utils/common/p2p_socket_test.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include "stream/metadata_stream.h" 18 | #include 19 | #include 20 | #include 21 | 22 | void run_server() { 23 | nixlMDStreamListener listener(8082); 24 | listener.startListenerForClient(); 25 | std::cout << listener.recvFromClient(); 26 | return; 27 | } 28 | 29 | void run_client() { 30 | nixlMDStreamClient client("127.0.0.1", 8082); 31 | client.connectListener(); 32 | std::string data = "Hello NixL MD listener\n"; 33 | client.sendData(data); 34 | std::cout << "Sent Data to listener " << data << "\n"; 35 | std::string ack = client.recvData(); 36 | std::cout << "Received from server: " << ack << "\n"; 37 | 38 | return; 39 | } 40 | 41 | int main (int argc, char *argv[]) { 42 | if (argc < 2) { 43 | std::cout << "Enter client/server\n"; 44 | exit(-1); 45 | } 46 | 47 | std::string arg1 = argv[1]; 48 | std::string server = "server"; 49 | std::transform(arg1.begin(), arg1.end(), arg1.begin(), ::tolower); 50 | 51 | if (arg1 == server) 52 | run_server(); 53 | else 54 | run_client(); 55 | 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /src/infra/test_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef NIXL_TEST_UTILS_H 18 | #define NIXL_TEST_UTILS_H 19 | 20 | #include 21 | #include "nixl_types.h" 22 | 23 | /** 24 | * @brief Exit on failure utility functions for tests and examples 25 | * 26 | * These functions provide a convenient way to check conditions and exit 27 | * with appropriate error messages if they fail. They are designed for 28 | * use in tests and examples where immediate termination on error is desired. 29 | */ 30 | 31 | /** 32 | * @brief Exit if nixl_status_t indicates failure 33 | * @param status The nixl status to check 34 | * @param message Error message to display 35 | * @param agent Optional agent name for context 36 | */ 37 | void 38 | nixl_exit_on_failure(nixl_status_t status, std::string_view message, std::string_view agent = {}); 39 | 40 | /** 41 | * @brief Exit if boolean condition is false 42 | * @param condition The condition to check (exits if false) 43 | * @param message Error message to display 44 | * @param agent Optional agent name for context 45 | */ 46 | void 47 | nixl_exit_on_failure(bool condition, std::string_view message, std::string_view agent = {}); 48 | 49 | #endif /* NIXL_TEST_UTILS_H */ 50 | -------------------------------------------------------------------------------- /src/plugins/gds_mt/gds_mt_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef __GDS_MT_UTILS_H 18 | #define __GDS_MT_UTILS_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | class gdsMtFileHandle { 26 | public: 27 | gdsMtFileHandle (int fd); 28 | ~gdsMtFileHandle(); 29 | 30 | gdsMtFileHandle (const gdsMtFileHandle &) = delete; 31 | gdsMtFileHandle & 32 | operator= (const gdsMtFileHandle &) = delete; 33 | gdsMtFileHandle (gdsMtFileHandle &&) = delete; 34 | gdsMtFileHandle & 35 | operator= (gdsMtFileHandle &&) = delete; 36 | 37 | int fd{-1}; 38 | CUfileHandle_t cu_fhandle{nullptr}; 39 | }; 40 | 41 | class gdsMtMemBuf { 42 | public: 43 | gdsMtMemBuf (void *ptr, size_t sz, int flags = 0); 44 | ~gdsMtMemBuf(); 45 | 46 | gdsMtMemBuf (const gdsMtMemBuf &) = delete; 47 | gdsMtMemBuf & 48 | operator= (const gdsMtMemBuf &) = delete; 49 | gdsMtMemBuf (gdsMtMemBuf &&) = delete; 50 | gdsMtMemBuf & 51 | operator= (gdsMtMemBuf &&) = delete; 52 | 53 | private: 54 | void *base_{nullptr}; 55 | bool registered_{false}; 56 | }; 57 | 58 | class gdsMtUtil { 59 | public: 60 | gdsMtUtil(); 61 | ~gdsMtUtil(); 62 | }; 63 | #endif 64 | -------------------------------------------------------------------------------- /benchmark/nixlbench/src/runtime/runtime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __RUNTIME_H 19 | #define __RUNTIME_H 20 | 21 | #include 22 | #include 23 | 24 | class xferBenchRTReq { 25 | public: 26 | friend class xferBenchRT; 27 | }; 28 | 29 | class xferBenchRT { 30 | private: 31 | int size; 32 | int rank; 33 | protected: 34 | void setSize(int s) { size = s; }; 35 | void setRank(int r) { rank = r; }; 36 | public: 37 | virtual ~xferBenchRT() {}; 38 | 39 | int getSize() const; 40 | int getRank() const; 41 | virtual int sendInt(int *buffer, int dest_rank) = 0; 42 | virtual int recvInt(int *buffer, int src_rank) = 0; 43 | virtual int broadcastInt(int *buffer, size_t count, int root_rank) = 0; 44 | virtual int sendChar(char *buffer, size_t count, int dest_rank) = 0; 45 | virtual int recvChar(char *buffer, size_t count, int src_rank) = 0; 46 | virtual int reduceSumDouble(double *local_value, double *global_value, int dest_rank) = 0; 47 | 48 | // Add a barrier function to synchronize all processes 49 | virtual int barrier(const std::string& barrier_id) = 0; 50 | }; 51 | 52 | #endif // __RUNTIME_H 53 | -------------------------------------------------------------------------------- /src/core/telemetry/buffer_exporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef _TELEMETRY_BUFFER_EXPORTER_H 18 | #define _TELEMETRY_BUFFER_EXPORTER_H 19 | 20 | #include "common/cyclic_buffer.h" 21 | #include "telemetry/telemetry_exporter.h" 22 | #include "telemetry_event.h" 23 | #include "nixl_types.h" 24 | 25 | #include 26 | 27 | constexpr const char telemetryDirVar[] = "NIXL_TELEMETRY_DIR"; 28 | 29 | /** 30 | * @class nixlTelemetryBufferExporter 31 | * @brief Shared memory buffer based telemetry exporter implementation 32 | * 33 | * This class implements the telemetry exporter interface to export 34 | * telemetry events to a shared memory buffer. 35 | */ 36 | class nixlTelemetryBufferExporter : public nixlTelemetryExporter { 37 | public: 38 | /** 39 | * @brief Constructor using init params (plugin-compatible) 40 | * @param init_params Initialization parameters 41 | */ 42 | explicit nixlTelemetryBufferExporter(const nixlTelemetryExporterInitParams &init_params); 43 | 44 | nixl_status_t 45 | exportEvent(const nixlTelemetryEvent &event) override; 46 | 47 | private: 48 | std::filesystem::path filePath_; 49 | sharedRingBuffer buffer_; 50 | }; 51 | 52 | #endif // _TELEMETRY_BUFFER_EXPORTER_H 53 | -------------------------------------------------------------------------------- /src/plugins/hf3fs/README.md: -------------------------------------------------------------------------------- 1 | # NIXL HF3FS Plugin 2 | 3 | This plugin utilizes `hf3fs_usrbio.so` as an I/O backend for NIXL. 4 | 5 | ## Usage 6 | 1. Build and install [3FS](https://github.com/deepseek-ai/3FS/). 7 | 2. Ensure that 3FS libraries,`hf3fs_usrbio.so` and `libhf3fs_api_shared.so`, are installed under `/usr/lib/`. 8 | 3. Ensure that 3FS headers are installed under `/usr/include/hf3fs`. 9 | 4. Build NIXL. 10 | 5. Once the HF3FS Backend is built, you can use it in your data transfer task by specifying the backend name as "HF3FS": 11 | 12 | ```cpp 13 | nixl_status_t ret1; 14 | std::string ret_s1; 15 | nixlAgentConfig cfg(true); 16 | nixl_b_params_t init1; 17 | nixl_mem_list_t mems1; 18 | nixlBackendH *hf3fs; 19 | nixlAgent A1(agent1, cfg); 20 | ret1 = A1.getPluginParams("HF3FS", mems1, init1); 21 | assert (ret1 == NIXL_SUCCESS); 22 | ret1 = A1.createBackend("HF3FS", init1, hf3fs); 23 | ... 24 | ``` 25 | 26 | ### Backend parameters 27 | Paramaters accepted by the HF3FS plugin during createBackend() 28 | - mem_config: Indicate if the plugin should create a shared memory on the user-provided memory ["dram", "dram_zc", "auto"] (default: "auto") 29 | - dram_zc: always create shared memory and return failure if shared memory creation fails. 30 | - dram: Never create shared memory 31 | - auto: the plugin will try to create a shared memory and fallback to non shared memory if fails. 32 | 33 | ## Performance tuning 34 | To get the best performance, please provide a memory that is page-aligned with sized the multiple of page size to `nixlAgent->registerMem()`. 35 | 36 | This plugin will try to shared the user provided memory direcrly with the 3FS backend process using mmap() to reduce data copy. 37 | mmap() requires the memory to be page-aligned, and size has to be multiple of page size. 38 | 39 | If the user-provided memory could not be shared, the plugin will allocate it's own memory to shared with 3FS backend process and copy the data between user-provided memory and the shared memory. 40 | -------------------------------------------------------------------------------- /test/unit/utils/serdes/serdes_test.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #include "serdes/serdes.h" 18 | #include 19 | #include 20 | 21 | int main() { 22 | 23 | int i = 0xff; 24 | std::string s = "testString"; 25 | std::string t1 = "i", t2 = "s"; 26 | int ret; 27 | 28 | nixlSerDes sd; 29 | 30 | ret = sd.addBuf(t1, &i, sizeof(i)); 31 | assert(ret == 0); 32 | 33 | ret = sd.addStr(t2, s); 34 | assert(ret == 0); 35 | 36 | std::string sdbuf = sd.exportStr(); 37 | assert(sdbuf.size() > 0); 38 | 39 | std::cout << "exported string: " << sdbuf << "\n"; 40 | 41 | // "nixlSDBegin|i 00000004000000ff|s 0000000AtestString|nixlSDEnd 42 | // |token |tag|size. |value. |tag|size | |token 43 | 44 | nixlSerDes sd2; 45 | ret = sd2.importStr(sdbuf); 46 | assert(ret == 0); 47 | 48 | size_t osize = sd2.getBufLen(t1); 49 | assert(osize > 0); 50 | 51 | void *ptr = malloc(osize); 52 | ret = sd2.getBuf(t1, ptr, osize); 53 | assert(ret == 0); 54 | 55 | std::string s2 = sd2.getStr(t2); 56 | assert(s2.size() > 0); 57 | 58 | assert(*((int*) ptr) == 0xff); 59 | 60 | assert(s2.compare("testString") == 0); 61 | 62 | free(ptr); 63 | 64 | return 0; 65 | } 66 | --------------------------------------------------------------------------------