‹ BackHN Continuity

Thread

Homa: The end of TCP for AI clusters [video]

67 points · 30 comments · signa11

Loading the complete thread in the background. This saved snapshot is available now. Refresh

  1. almost_usual · · focus · HN ↗
    <a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;1003059&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;1003059&#x2F;

    <a href="https:&#x2F;&#x2F;www.usenix.org&#x2F;system&#x2F;files&#x2F;atc21-ousterhout.pdf" rel="nofollow">https:&#x2F;&#x2F;www.usenix.org&#x2F;system&#x2F;files&#x2F;atc21-ousterhout.pdf

    1. dang · · focus · HN ↗
      Thanks, those are great! Added to toptext.
      1. swyx · · focus · HN ↗
        (talk curator here) we also transcribed with a light summary <a href="https:&#x2F;&#x2F;ai.engineer&#x2F;talks&#x2F;eZ8WWZzoaR0-homa-end-tcp-ai-clusters" rel="nofollow">https:&#x2F;&#x2F;ai.engineer&#x2F;talks&#x2F;eZ8WWZzoaR0-homa-end-tcp-ai-cluste...
  2. paradiselord-de · · focus · HN ↗

    [dead]

  3. nickysielicki · · focus · HN ↗
    To be honest, I just don’t find this problem space that interesting anymore. At AI cluster scale, accelerator time is vastly more expensive than redundant network capacity. It’s going to be this way for at least the next half decade. And once you control the endpoints, NICs, topology, and workload, “just massively overprovision the fabric to prevent congestion entirely” starts looking like a pretty compelling congestion-control algorithm. Once that half decade is up and these inefficiencies become a bottleneck again, AI is going to be able to vibecode a slopgorithm on NS3 that outperforms all of these and makes it moot.
  4. giovannibonetti · · focus · HN ↗
    [delayed]
    1. cma · · focus · HN ↗
      Google TPUs use optically routable fibers like circuit switching to be able to change the whole topology of the setup depending on training load&#x2F;problem dimensions.
      1. smj-edison · · focus · HN ↗
        I remember reading about their setup and it blew my mind. They have MEMS mirrors that can rotate to redirect one of thousands of fiber lines into any other fiber line by using other optics. That way you can take in like 1000 lines and optically connect it to any of the other 1000 lines.
  5. adastra22 · · focus · HN ↗
    Please don’t make the primary link a video.
  6. jMyles · · focus · HN ↗
    I wonder if, as LLMs get accustomed to using homa or some other optimized protocol for, as the article lists, &quot;chores such as weight gradients, model weights, KV cache entries, and checkpoints&quot;, whether we&#x27;ll start to see TCP as a bottleneck for their post-trained interactions as well, for many of the reasons.
  7. wmf · · focus · HN ↗
    I&#x27;ve been hearing about Homa for years and wondered what&#x27;s new. I found a changelog in the readme of the git repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;PlatformLab&#x2F;HomaModule" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;PlatformLab&#x2F;HomaModule
  8. Animats · · focus · HN ↗
    Homa has been around for a while. Here&#x27;s the 2018 paper.[1]

    The core idea: When a message arrives at the sender’s transport module, Homa divides the message into two parts: an initial unscheduled portion (the first RTTbytes bytes), followed by a scheduled portion. The sender transmits the unscheduled bytes immediately, using one or more DATA packets. The scheduled bytes are not transmitted until requested explicitly by the receiver using GRANT packets.

    So it sends blind for short requests, then needs a go-ahead from the receiver. That&#x27;s reasonable when the main application is a remote procedure call. It&#x27;s reminiscent of QNX&#x27;s networking protocol, which is also single packet message request&#x2F;response but can also handle arbitrarily long messages.

    What makes this work today is that per-packet processing overhead in hardware switches is low vs. per-byte overhead. In early software driven switches, per-packet overhead tended to dominate, and sending small packets was very inefficient. In modern hardware switches, where FPGAs are doing the processing, the per-packet overhead is low enough that small packets are not inefficient.

    It&#x27;s amusing that web stuff is so bloated today that any transaction under 1MB is considered &quot;small&quot;. So this is not a suitable protocol for open web use.

    [1] <a href="https:&#x2F;&#x2F;people.csail.mit.edu&#x2F;alizadeh&#x2F;papers&#x2F;homa-sigcomm18.pdf" rel="nofollow">https:&#x2F;&#x2F;people.csail.mit.edu&#x2F;alizadeh&#x2F;papers&#x2F;homa-sigcomm18....

    1. Procrastes · · focus · HN ↗
      Upvote for the QNX mention! I loved using QNX for RT control stuff.

      Also, thanks for the clear summary and context.

    2. wmf · · focus · HN ↗
      The packet sizes should be the same for TCP or Homa; the difference is in sender-based vs. receiver-based congestion control.
  9. throw0101c · · focus · HN ↗
    With regards congestion (~6:01) about &quot;congestion control is the responsibility of the sender&quot; and &quot;somehow we have to get the sending nodes to stop sending so fast&quot;. Does that not exist in Ethernet&#x2F;RoCE?

    &gt; Link Level Flow Control: InfiniBand uses a credit-based algorithm to guarantee lossless HCA-to-HCA communication. RoCE runs on top of Ethernet. Implementations may require lossless Ethernet network for reaching to performance characteristics similar to InfiniBand. Lossless Ethernet is typically configured via Ethernet flow control or priority flow control (PFC). Configuring a Data center bridging (DCB) Ethernet network can be more complex than configuring an InfiniBand network.[19]

    * <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;RDMA_over_Converged_Ethernet" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;RDMA_over_Converged_Ethernet

    &gt; A sending station (computer or network switch) may be transmitting data faster than the other end of the link can accept it. Using flow control, the receiving station can signal the sender requesting suspension of transmissions until the receiver catches up. Flow control on Ethernet can be implemented at the data link layer.

    * <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ethernet_flow_control" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ethernet_flow_control

    1. lokar · · focus · HN ↗
      The issue is never really with the destination, it’s some link&#x2F;switch along the way.

      When a link becomes saturated working out how to manage that is a hard problem.

      I have only used RoCE once at scale, it was really finicky. We would get big waves to pause frames that stalled everything.

    2. wmf · · focus · HN ↗
      Flow control is better than nothing but it can cause congestion spreading and bufferbloat. QCN, Falcon, and Ultra Ethernet provide much better congestion control for RoCE but they also require newer hardware compared to Homa.
    3. teraflop · · focus · HN ↗
      Ethernet flow control doesn&#x27;t really fix congestion except in very special cases.

      Consider a very simple topology:

          A         C
           \       &#x2F;
            S1===S2
           &#x2F;       \
          B         D
      
      Say hosts A and B are both sending data to C, as fast as they can, via switches 1 and 2 (which are connected via a high-speed link). And say the sum of these two flows is more than the capacity of the link to C.

      S2 is receiving packets destined for C faster than it can forward them, but sending an Ethernet pause frame from S2 to S1 is not a very productive way to alleviate the situation, because it also disrupts any traffic that would be bound for D. It just moves the bottleneck elsewhere and causes collateral damage.

      1. 486sx33 · · focus · HN ↗

        [dead]

      2. stingraycharles · · focus · HN ↗
        Maybe, but doesn’t RoCE &#x2F; RDMA handle this at a higher level as well? It’s why PFC and ECN are required for these deployments, which effectively ensure everyone behaves nicely.

        I agree that Ethernet flow control is insufficient, but given that NVidia in an act of brilliant foresight acquired Mellanox a decade ago, I’m fairly certain that this is how all these AI clusters are actually deployed, not using TCP, and maybe not even using Ethernet but infiniband instead.

  10. Veserv · · focus · HN ↗
    Homa is not a good design.

    1. No way to detect whole RPC loss. Since there is no outer connection state, if every packet in the send-side of a RPC is lost then there is no way for a server to detect that it should issue a resend. The RPC is just lost to the ether. This affects small messages, like messages that fit in a single packet, more since there are fewer packets in the send-side.

    2. Related to the above, there is no builtin encryption support. So, if you want encryption then you need to layer it either above or below.

    3. Benchmarked performance is awful. The 60 kB average message case in [1] Table 4 takes 5(!) hyperthreads to average 20 Gbit&#x2F;s. That is just 4 Gbit&#x2F;s per hyperthread. Even a totally naive one-packet per system call network protocol design and implementation should get to ~8 Gbit&#x2F;s per hyperthread. 30 Gbit&#x2F;s per core is easy with just a little focus on performance.

    4. Despite all the performance design problems in QUIC (though still faster than Homa) it already solves basically every problem Homa is trying to solve in a much cleaner way. Stream IDs correspond to RPC IDs. Stream Max corresponds to Grants. Multiple streams under single Client allows prioritization.

    Except you do not randomly lose entire messages. You can compact small messages into packets. You get more precise RTT time allowing more accurate pacing&#x2F;congestion calculations. You get builtin encryption. It survives ossified middleboxs. It has multiple ack frames&#x2F;packets reducing ack overhead.

    The only real difference is that Homa uses explicit receiver Resend instead of implicit sender Resend. Except that actually consumes significantly more receiver resources in non-trivial loss scenarios especially due to Resend packets only supporting a single Resend span. It also incurs higher latency and has higher requirements on the entire lossy network path due to all the extra transiting data that you do not want to lose.

    And those are just serious problems off the top of my head after reloading the RFC into my head. I can come up with some more if needed.

    [1] <a href="https:&#x2F;&#x2F;www.usenix.org&#x2F;system&#x2F;files&#x2F;atc21-ousterhout.pdf" rel="nofollow">https:&#x2F;&#x2F;www.usenix.org&#x2F;system&#x2F;files&#x2F;atc21-ousterhout.pdf

    1. KerrAvon · · focus · HN ↗
      QUIC is much more well known than Homa. Are there downsides for using it for this application?
      1. Veserv · · focus · HN ↗
        Compared to TCP or Homa at a protocol design level? Not really.

        However, software QUIC implementations are generally much slower than software TCP implementations. This is not due to any fundamental protocol design limitations, it is just that most&#x2F;every QUIC implementation is poorly implemented for maximizing performance.

        You can, of course, do multiple times more throughput than QUIC or TCP with a protocol better designed for performance, but that is likely orthogonal to your question.

    2. wmf · · focus · HN ↗
      1. You have to use timeouts just like TCP has a SYN timeout.

      2. TCP doesn&#x27;t have encryption either. They should probably show DTLS working though.

      4. You can&#x27;t just say QUIC is faster without testing it.

      1. Veserv · · focus · HN ↗
        1. I do not see where they discuss that in the RFC. While that would work, it is awful.

        That is a sender-driven resend and as such relies on the sender identifying the “send lost” condition. However, the entire protocol is designed around not doing that and thus you can only feasibly rely on “should have received a reply by now” as your timeout.

        But Homa is intended to be a RPC protocol. So you send to server, wait for server to process command, then wait for server to send reply. Your timeout depends on the variable and heterogeneous command processing time.

        Even if you were able to give a separate correctly tuned timeout for every possible RPC that is still awful. Any RPC with long processing time should not trigger the timeout until the expected reply time, but if that is far larger than the RTT then you are waiting a tremendous amount of time. For instance, a select query that is only a few bytes long (and thus fits in one packet) could take seconds on a large database even though the database server is physically nearby and only microseconds away. In that case you would have to wait seconds before timing out instead of just microseconds like a ack-based design could achieve.

        4. MsQuic at 7.5 Gbit&#x2F;s: <a href="https:&#x2F;&#x2F;microsoft.github.io&#x2F;msquic&#x2F;" rel="nofollow">https:&#x2F;&#x2F;microsoft.github.io&#x2F;msquic&#x2F;

        1. wmf · · focus · HN ↗
          You keep talking about Gbits but Homa is about latency.
          1. Veserv · · focus · HN ↗
            There is nothing in the design that supports low latency relative to a protocol like QUIC. Basically the entire “latency” advantage it has over TCP is just that it does not head-of-line block which QUIC also does not do.

            And then in basically every other respect it is worse including compatibility.

    3. tcdent · · focus · HN ↗
      Why would you run encryption between nodes in an AI cluster?
      1. MrDrMcCoy · · focus · HN ↗
        So that any sensitive data stupidly uploaded doesn&#x27;t get leaked, which includes &quot;zero-retention&quot; corporate stuff. Anything that could get sniffed by employees and other agents. It really should be standard practice for any data passing between nodes, even if it&#x27;s all within a site.
      2. vlovich123 · · focus · HN ↗
        <a href="https:&#x2F;&#x2F;www.infoworld.com&#x2F;article&#x2F;2204886&#x2F;what-s-on-tap-at-the-nsa-google-s-and-yahoo-s-private-fiber-backbones.html" rel="nofollow">https:&#x2F;&#x2F;www.infoworld.com&#x2F;article&#x2F;2204886&#x2F;what-s-on-tap-at-t...

        Because the NSA and similar organizations will 100% infiltrate the physical infrastructure. It’s easier and harder if not impossible to detect.

      3. Veserv · · focus · HN ↗
        Homa was proposed as a datacenter-centric protocol for intra-DC traffic. In that context, with heterogeneous compute loads with various levels of criticality and confidentiality requirements, not considering how to layer encryption better is a design flaw.
  11. swyx · · focus · HN ↗
    curator here - was very honored that John came inbound to do this with us. note: we transcribed and summarized the talk here as we now do for all talks - <a href="https:&#x2F;&#x2F;ai.engineer&#x2F;talks&#x2F;eZ8WWZzoaR0-homa-end-tcp-ai-clusters" rel="nofollow">https:&#x2F;&#x2F;ai.engineer&#x2F;talks&#x2F;eZ8WWZzoaR0-homa-end-tcp-ai-cluste...
  12. ContinuityLab · · focus · HN ↗
    A compelling architectural look at moving beyond traditional TCP to optimize latency and throughput for modern distributed AI workloads. Low-level networking is becoming the ultimate bottleneck.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.