feat: add RDMA support to MLX backend via mlx-jaccl-cluster integration#8623
Open
localai-bot wants to merge 1 commit intomudler:masterfrom
Open
feat: add RDMA support to MLX backend via mlx-jaccl-cluster integration#8623localai-bot wants to merge 1 commit intomudler:masterfrom
localai-bot wants to merge 1 commit intomudler:masterfrom
Conversation
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR integrates RDMA support with the MLX backend in LocalAI to enable high-performance distributed inference on Apple Silicon machines.
Summary of Changes
1. Backend Changes (
backend/python/mlx/backend.py)parse_rdma_options()function to extract RDMA configuration fromModelOptions.Optionsmx.distributed.init(backend="jaccl")call if RDMA is enabledmodel.shard(mx.distributed.world_size())mlx_rdma.enabled:true,mlx_rdma.ctrl_host:0.0.0.0, etc.)2. Core CLI Changes (
core/cli/run.go)MLX_GRPC_SERVERSenvironment variable support in theTunnelCallbackMLX_RDMA_ENABLED=true, the P2P worker IPs/ports are exposed to the backend viaMLX_GRPC_SERVERS3. Integration Pattern (Aligned with llama.cpp)
local-ai worker mlx_rdma(similar tollama.cpp)MLX_GRPC_SERVERSenv var for the backendMLX_GRPC_SERVERSand initializes RDMA if enabled4. RDMA Options Format
Options are passed as
repeated stringlist inModelOptions.Options:Usage Example
local-ai worker mlx_rdma --host <ip>local-ai run --mlx_rdma.enabled:true ...