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,
the exact header implementation of src/api/cpp is done through pybind11 that can be found in src/bindings/python.
The Python bindings provide access to the full NIXL API including:
- Agent Management: Create and configure NIXL agents
- Memory Registration: Register and deregister memory/storage
- Transfer Operations: Create and manage data transfers
- QueryMem API: Query memory/storage information and accessibility
- Backend Management: Create and configure different backends (UCX, GDS, etc.)
The nixl python API and libraries, including UCX, are available directly through PyPI:
pip install nixlTo build from source, follow the main build instructions in the README.md, then install the Python bindings:
# From the root nixl directory
pip install .Backends expose their initialization parameters through get_plugin_params(backend), which
returns the defaults. Override the values you need before passing the map to create_backend:
from nixl import nixl_agent, nixl_agent_config
# backends=[] leaves backend creation to the caller. The default config
# initializes UCX, and a backend can only be created once per agent.
agent = nixl_agent("example_agent", nixl_agent_config(backends=[]))
params = agent.get_plugin_params("UCX")
params["ucx_error_handling_mode"] = "peer" # or "none"
agent.create_backend("UCX", params)See UCX backend initialization options
for the supported UCX keys and their semantics. Note that ucx_error_handling_mode influences
UCP transport lane selection in addition to error reporting.
See the Python examples directory for complete working examples including:
- query_mem_example.py - QueryMem API demonstration
- nixl_gds_example.py - GDS backend usage
- nixl_api_example.py - General API usage
- basic_two_peers.py - Basic transfer operations
- partial_md_example.py - Partial metadata handling