This script enables transfering files from one Mac to another using MLX distributed.
First configure the nodes if you haven't already
mlx.distributed_config --verbose --hosts hostname1,hostname2 --backend jaccl \
--env MLX_METAL_FAST_SYNCH=1 --auto-setup --output hostfile.jsonthen all you have to from one of the two nodes
mlx.launch --verbose --hostfile hostfile.json -- file_transfer.py <src-path> <dst-path>You can also initiate the copy from another node
mlx.launch --verbose --hostfile hostfile.json --no-verify -- \
/full/path/to/python file_transfer.py <src-path> <dst-path>In the following I am transferring a 5GB file from one node to another
$ mlx.launch --verbose --hostfile m3-ultra-2x.json --no-verify -- \
/Users/angelos/miniconda3/envs/mlx/bin/python file_transfer.py --from 1 --to 0 /tmp/src.gz /tmp/dst.gz
[INFO] Running /Users/angelos/miniconda3/envs/mlx/bin/python file_transfer.py --from 1 --to 0 /tmp/src.gz /tmp/dst.gz
Sending /tmp/src.gz: 87% 4.20G/4.83G [00:00<00:00, 6.49GB/s]Received 4826186110 bytes in 0.77s (5942.16 MB/s)
Sending /tmp/src.gz: 100% 4.83G/4.83G [00:00<00:00, 6.19GB/s]
Sent 4826186110 bytes in 0.78s (5900.61 MB/s)
[INFO] Node with rank 1 completed
[INFO] Node with rank 0 completed