feat: integrate RDMA support with MLX backend#1
Draft
localai-bot wants to merge 1 commit intomasterfrom
Draft
Conversation
- Add mlx_rdma_enabled environment variable check in MLX backend - Initialize mlx.distributed when MLX_GRPC_SERVERS is set - Add mlx-rdma worker type to CLI worker commands - Set MLX_GRPC_SERVERS env var alongside LLAMACPP_GRPC_SERVERS
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 adds RDMA support to the MLX backend in LocalAI, enabling distributed inference across Apple Silicon machines.
Summary of Changes
Backend Enhancements (
backend/python/mlx/backend.py)_initialize_rdma()method to initializemlx.distributedwhenMLX_GRPC_SERVERSis setCLI Worker Support (
core/cli/worker/worker_mlx.go)mlx-rdmaworker type for launching MLX backends in distributed modellama.cppworkers (no P2P registration, usesMLX_GRPC_SERVERS)P2P Integration (
core/cli/run.go)MLX_GRPC_SERVERSenvironment variable alongsideLLAMACPP_GRPC_SERVERSinTunnelCallbackDesign Decisions
local-ai worker mlx-rdma, we don't need automatic process spawning viamlx.launch --hostfileMLX_GRPC_SERVERS(same asLLAMACPP_GRPC_SERVERS) to pass worker IPs to the backendTesting
local-ai run --p2p --token <token>local-ai worker mlx-rdmaMLX_GRPC_SERVERSenv varMLX_GRPC_SERVERSis setNotes
mlxwith JACCL backend support (mlx-jaccl-clusterintegration)model.shard(mx.distributed.world_size())