# Custom transport for Distributed.jl to utilize Infiniband and avoid MPI?

**URL:** https://discourse.julialang.org/t/custom-transport-for-distributed-jl-to-utilize-infiniband-and-avoid-mpi/74097
**Category:** General Usage
**Tags:** parallel, cluster
**Created:** [January 5, 2022, 5:36pm UTC](https://discourse.julialang.org/t/custom-transport-for-distributed-jl-to-utilize-infiniband-and-avoid-mpi/74097 "2022-01-05T17:36:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)
#### Post date: [January 5, 2022, 5:36pm UTC](https://discourse.julialang.org/t/custom-transport-for-distributed-jl-to-utilize-infiniband-and-avoid-mpi/74097/1 "2022-01-05T17:36:49Z")

</div>

Hi,  
I was wondering if there’s any prospect of Distributed.jl and/or Dagger.jl to support interconnects such as Infiniband on HPC clusters?

There’s a nice summary of the downsides of MPI.jl and Distributed.jl in this post:

> [@Distributed.jl vs MPI.jl](https://discourse.julialang.org/t/distributed-jl-vs-mpi-jl/71315/21):
>
> They are somewhat different models of parallelism: [MPI.jl](https://github.com/JuliaParallel/MPI.jl) is based on a single-program multiple-data (SPMD) model, where (typically) all processes run the same program and periodically perform some communication operation to other processes. As a very well-established paradigm, lots of time and money have been spent optimizing these operations, both in terms of hardware (MPI is able to leverage fast interconnects, such as Infiniband), as well as software support (it ultimately underlies almos…

with the main downside of Distributed.jl being the missing Infiniband support. It would be great to circumvent going to MPI only for this.

I found only one post addressing this, saying that a custom transport could be implemented, but is not easily done:

> [@Implementing parallel fluids code in Julia (parallel FFTW, MPI.jl, ...)](https://discourse.julialang.org/t/implementing-parallel-fluids-code-in-julia-parallel-fftw-mpi-jl/2689/6):
>
> The [Cluster Managers with custom transports](http://docs.julialang.org/en/stable/manual/parallel-computing/#cluster-managers-with-custom-transports) section in the Julia documentation has a little information on creating custom transport layers for Julia’s native distributed memory parallelism. There’s an example in the Julia distribution of an implementation using the zmq library. I’ve had a thorough look through the internet for an infiniband implementation but haven’t been able to find one. I looked into doing it myself and it looks like a lot of work. However, I know very little about networki…

Now I’m no expert on any of this, but I think if the Julia internal Distributed.jl could leverage Infiniband interconnects it would be a big advantage. Especially to those people (like me) who do not want to rethink their whole code in MPI-style. I’d be happy to hear if there are any projects or intentions to support this!

Thanks 🙂

---

<div class="post-metadata">

### Author: ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)
#### Post date: [January 5, 2022, 10:03pm UTC](https://discourse.julialang.org/t/custom-transport-for-distributed-jl-to-utilize-infiniband-and-avoid-mpi/74097/2 "2022-01-05T22:03:06Z")

</div>

Shooting in the dark, would [https://github.com/JuliaParallel/UCX.jl](https://github.com/JuliaParallel/UCX.jl) work here?

---

<div class="post-metadata">

### Author: ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)
#### Post date: [January 6, 2022, 10:23am UTC](https://discourse.julialang.org/t/custom-transport-for-distributed-jl-to-utilize-infiniband-and-avoid-mpi/74097/3 "2022-01-06T10:23:38Z")

</div>

I don’t know UCX and what it does exactly, the [ucx github page](https://github.com/openucx/ucx) mentions Infiniband communication though. If I look at the [UCX.jl example](https://github.com/JuliaParallel/UCX.jl/blob/main/examples/benchmarks/ucx/latency.jl) it does not look like a significant improvement over MPI.jl? Or do you mean to use ucx as an example for an implementation of the transport for Distributed.jl?

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [January 6, 2022, 1:19pm UTC](https://discourse.julialang.org/t/custom-transport-for-distributed-jl-to-utilize-infiniband-and-avoid-mpi/74097/4 "2022-01-06T13:19:19Z")

</div>

UCX implements support for a large number of network fabrics; OpenMPI uses UCX to access those fabrics and other communication schemes. I think that UCX.jl will probably be the future of custom transports for Distributed data transfer.

@vchuravy has been working on getting UCX.jl to underpin Distributed, and has had recent success with implementing a UCX-backed `IOStream` that Distributed should be able to use.

---

<div class="post-metadata">

### Author: ![charlescolley](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@charlescolley](https://discourse.julialang.org/u/charlescolley)
#### Post date: [October 20, 2022, 3:29pm UTC](https://discourse.julialang.org/t/custom-transport-for-distributed-jl-to-utilize-infiniband-and-avoid-mpi/74097/5 "2022-10-20T15:29:49Z")

</div>

Do you have any pointers on where I can learn more about supporting Infiniband in pure julia?

I have a project which is currently suffering from the low bandwidth of TCP connections and I’d like to write something which can support larger bandwidth which could be used by Distributed.jl. I’m admittedly new to writing something like this (my only experience is working with UDP + TCP connections in a networking course) but I’d like to learn. I’ve had a look at the [relevant ClusterManager documentation](https://engaging-web.mit.edu/~alir/cnhlab004/julia-1.5.3/share/doc/julia/html/en/manual/distributed-computing.html#Cluster-Managers-with-Custom-Transports), the clustermanager/0mq example mentioned within, and the UCX.jl package, but I’m still unable to properly determine what fully needs to be written before I can support Infiniband.

Using UCX.jl to underpin the communication of Distributed.jl seems like the most promising first step (given the preliminary results in the last slide of [this presentation](https://raw.githubusercontent.com/wiki/openucx/ucx/UCF2021_slides/UCF2021_paper_4.pdf)), but the documentation in the package is sparse and I’m not sure how to integrate it.
