←All research digests研究導讀總表
Research digest研究導讀
Research digest 11 of 16 · Chapter 4: Collective communication
研究導讀 11 / 16 · 第 4 章:集體通訊

Trivance: Latency-Optimal AllReduce by Shortcutting Multiport NetworksTrivance:在多埠網路上抄捷徑,達到延遲最佳的 AllReduce

After reading, you can explain how Trivance uses both ports of a ring node to finish an all-reduce in ⌈log₃ n⌉ steps, and what it pays in link load and synchronization.讀完後,你能說明 Trivance 如何同時使用環上節點的兩個埠,以 ⌈log₃ n⌉ 步完成 all-reduce,以及它在鏈路負載與同步上付出的代價。

≈ 10 min · 1 interactive panel · 5-question quiz≈ 10 分鐘 · 1 個互動面板 · 5 題測驗Chapter 4 ↗第 4 章 ↗Jump to the quiz ↓跳到測驗 ↓
If you read nothing else
只讀這一段也可以

A ring node has two ports, so in one step it can learn from two new peers and its reach can triple: the lower bound for all-reduce is ⌈log⁡3n⌉\lceil \log_3 n \rceil steps, not log⁡2n\log_2 n. Bruck's algorithm meets the bound but sends both messages the same way, so links carry three times the needed load. Recursive doubling and Swing need log⁡2n\log_2 n steps and use the second port only for a mirrored copy. In Trivance each node exchanges in step kk with the peers 3k3^k to its left and right, and reduces both inputs with its own partial result before it forwards. That takes about 37% fewer steps than log⁡2n\log_2 n, puts exactly 3k3^k chunks on every link, and keeps the minimal 2m2m bytes in the bandwidth-optimal form. The evidence is a cost model plus simulation, so this page teaches the model.

環上的節點有兩個埠,一步之內可以從兩個新夥伴取得資料,涵蓋範圍可以變成三倍:all-reduce 的步數下限是 ⌈log⁡3n⌉\lceil \log_3 n \rceil,而不是 log⁡2n\log_2 n。Bruck 演算法達到這個下限,但兩則訊息都往同一方向走,鏈路負載是必要值的三倍。遞迴倍增與 Swing 需要 log⁡2n\log_2 n 步,第二個埠只用來跑 mirrored 副本。在 Trivance 中,每個節點在第 kk 步與左右各 3k3^k 遠的夥伴交換,並把兩個輸入與自己的部分結果一起歸約後再轉送。步數比 log⁡2n\log_2 n 少約 37%,每條鏈路恰好承載 3k3^k 個 chunk,頻寬最佳的形式仍只送出最少的 2m2m 位元組。證據是成本模型加上模擬,所以本頁教的是模型。

1. Where this paper sits1. 這篇論文的位置

The Chapter 4 charges α\alpha once per dependent step (section 2). Its section 9.2 gives Trivance's step count for 4,096 ranks, 8 against 12 for recursive doubling, and Panel 4 in section 4 animates its peers on a ring. The Swing digest shows how distance becomes link sharing on a torus.

第 4 章對每個相依步驟收一次 α\alpha(第 2 節)。它的第 9.2 節給出 Trivance 在 4,096 個 rank 上的步數,8 步對遞迴倍增的 12 步;第 4 節的面板 4 以動畫呈現它在環上的夥伴。Swing 導讀說明在環面上距離如何變成鏈路共用。

What was missing: every logarithmic all-reduce used one peer per step. A mirrored copy on the second port halves each message but keeps log⁡2n\log_2 n steps. Bruck (1994) showed that two ports allow log⁡3n\log_3 n steps for all-gather and all-to-all, and Chan et al. proved a lower bound of ⌈log⁡2D+1n⌉\lceil \log_{2D+1} n \rceil steps on a DD-dimensional torus with 2D2D ports. No all-reduce reached the bound with an even load on all links.

缺少的是:每一種對數步數的 all-reduce 每步都只有一個夥伴。在第二個埠上跑 mirrored 副本能讓每則訊息減半,但步數仍是 log⁡2n\log_2 n。Bruck(1994)證明兩個埠能讓 all-gather 與 all-to-all 只要 log⁡3n\log_3 n 步;Chan 等人證明,在每節點 2D2D 個埠的 DD 維環面上,步數下限是 ⌈log⁡2D+1n⌉\lceil \log_{2D+1} n \rceil。過去沒有任何 all-reduce 在所有鏈路負載均勻的情況下達到這個下限。

2. The problem: three ways to use two ports2. 問題:使用兩個埠的三種方式

The paper's Figure 1 (below) compares three schedules step by step: recursive doubling on an 8-node ring, and Bruck and Trivance on a 9-node ring. Arrows are messages; the label under each step is the largest number of messages that share one link.

論文的 Figure 1(下圖)逐步比較三種排程:8 節點環上的遞迴倍增,以及 9 節點環上的 Bruck 與 Trivance。箭頭是訊息;每一步下方的標示是共用同一條鏈路的訊息數最大值。

Three rows of ring diagrams with numbered nodes and arcs for each step, annotated with message size and maximum congestion.
Figure 1 of the paper: recursive doubling (8 nodes), Bruck and Trivance (9 nodes), step by step (an algorithm schematic, not data). Green arrows are the original collective, dashed purple the mirrored copy that recursive doubling runs on its second port. Bruck and Trivance both finish in two steps, but Bruck sends both messages the same way round the ring, so its busiest link carries three times as many messages as Trivance's.論文圖 1:遞迴倍增(8 個節點)、Bruck 與 Trivance(9 個節點)的逐步交換(演算法示意圖,不是資料)。綠色箭頭是原本的集體通訊,紫色虛線是遞迴倍增在第二個埠上跑的 mirrored 副本。Bruck 與 Trivance 都兩步完成,但 Bruck 的兩則訊息沿環往同一方向走,所以它最忙的鏈路承載的訊息數是 Trivance 的三倍。Juerss, Addanki and Schmid, SIGCOMM 2026, Figure 1 (camera-ready PDF, p. 2, re-rendered).

The table restates the figure (all values are counts from the schedules, not measurements):

下表重述這張圖(數值都是由排程數出來的,不是量測):

Schedule (ring size)排程(環的大小)Steps步數Use of the second port第二個埠的用法Link load鏈路負載
Recursive doubling (8)遞迴倍增(8)3independent mirrored copy獨立的 mirrored 副本at most 1, 2, then 4 messages per link每條鏈路最多 1、2、4 則訊息
Bruck (9)Bruck(9)2second message, same direction第二則訊息,同一方向at most 3, then 9; all traffic one way, reverse links idle最多 3、9 則;全部流量走同一方向,反向鏈路閒置
Trivance (9)Trivance(9)2second peer, opposite direction第二個夥伴,反方向exactly 1, then 3, on every link每條鏈路恰好 1、3 則

The paper's motivation is cited, not measured: on large production systems more than 40% of MPI time goes to all-reduce and reduce, and TPU v4 builds 3D tori of up to 4,096 chips.

論文的動機是引用而非自己量測:在大型正式系統上,超過 40% 的 MPI 時間花在 all-reduce 與 reduce,而 TPU v4 以最多 4,096 顆晶片組成三維環面。

3. The design3. 設計

3.1 Two peers per step, reduced together3.1 每步兩個夥伴,一起歸約

In step kk, node rr of an nn-node ring talks to two peers at once:

在 nn 個節點的環上,第 kk 步節點 rr 同時與兩個夥伴通訊:

πleft=r−3k mod nπright=r+3k mod n \begin{aligned} \pi_{\text{left}} &= r - 3^k \bmod n \\ \pi_{\text{right}} &= r + 3^k \bmod n \end{aligned}

It must receive and reduce both inputs, with its own partial result, before it sends in step k+1k+1. The paper calls this joint reduction. By Lemma 4.2, after step kk node rr holds the data of every node within distance

它必須收到兩個輸入,並與自己的部分結果一起歸約,才能在第 k+1k+1 步送出。論文稱之為聯合歸約(joint reduction)。依 Lemma 4.2,第 kk 步之後,節點 rr 持有距離在下列範圍內所有節點的資料:

Rk=∑i=0k3i=3k+1−12(1, 4, 13, 40, … ) R_k = \sum_{i=0}^{k} 3^i = \frac{3^{k+1} - 1}{2} \qquad (1,\ 4,\ 13,\ 40,\ \dots)

Why (Appendix A): the 3k+1−13^{k+1} - 1 nodes between rr and its right peer split into two ranges of RkR_k nodes, one known to rr and one known to the peer. Each exchange brings only new data, so the covered set triples each step (Figure 1). For n=3sn = 3^s the ring's diameter equals Rs−1R_{s-1}, so ss steps reach every node.

原因(附錄 A):rr 與右側夥伴之間的 3k+1−13^{k+1} - 1 個節點分成兩段,各 RkR_k 個,一段 rr 已知,另一段夥伴已知。每次交換帶來的都是新資料,所以涵蓋的集合每步變三倍(圖 1)。當 n=3sn = 3^s,環的直徑等於 Rs−1R_{s-1},所以 ss 步就能到達每個節點。

Swing (one peer per step)Swing(每步一個夥伴)Trivance (two peers per step)Trivance(每步兩個夥伴)after step 0第 0 步後2after step 1第 1 步後4after step 2第 2 步後8after step 0第 0 步後3after step 1第 1 步後9after step 2第 2 步後27−13−4−10+1+4+13new in this step該步新增known before先前已知that step's peer該步的夥伴rank r
Swing (one peer per step)Swing(每步一個夥伴)Trivance (two peers per step)Trivance(每步兩個夥伴)after step 0第 0 步後2after step 1第 1 步後4after step 2第 2 步後8after step 0第 0 步後3after step 1第 1 步後9after step 2第 2 步後27−13−4−10+1+4+13new in this step該步新增known before先前已知that step's peer該步的夥伴rank r
Figure 1. The nodes whose data rank rr (outlined) holds after each step, on 27 positions around rr. Solid cells are new in that step, half-transparent cells were known before, and dots mark that step's peers. Swing's set doubles (2, 4, 8); Trivance's triples (3, 9, 27), so 27 nodes need 3 steps instead of 5.圖 1。rank rr(外框)在每一步之後持有哪些節點的資料,畫出 rr 周圍 27 個位置。實心格子是該步新增的,半透明格子是先前已知的,圓點標出該步的夥伴。Swing 的集合每步加倍(2、4、8);Trivance 的集合每步變三倍(3、9、27),所以 27 個節點只要 3 步而不是 5 步。Drawn for this primer from Lemma 4.2 of Juerss, Addanki and Schmid, SIGCOMM 2026, and Eq. 2 of the Swing paper.

The paper's Figure 3 (below) follows every node on a 9-node ring: node 0 gets nodes 1 and 8 in step 0, then 2, 3 and 4 through node 3, and 5, 6 and 7 through node 6.

論文的 Figure 3(下圖)追蹤 9 節點環上的每個節點:節點 0 在第 0 步得到節點 1 與 8 的資料,接著經由節點 3 得到 2、3、4,經由節點 6 得到 5、6、7。

Two ring diagrams of nine nodes with exchange arrows, each beside a 9 by 9 grid of ticks showing which blocks each node holds.
Figure 3 of the paper: received blocks on a 9-node ring (an algorithm schematic). In each grid, column cc lists the nodes whose data node cc holds. After step 0 every column has 3 ticks (itself and both neighbours); after step 1, through the peers 3 hops away, it has all 9 — the count triples each step, so ⌈log⁡3n⌉\lceil \log_3 n \rceil steps are enough.論文圖 3:9 節點環上收到的區塊(演算法示意圖)。每個網格中,第 cc 欄列出節點 cc 持有哪些節點的資料。第 0 步後每欄有 3 個勾(自己與兩個鄰居);第 1 步經由相隔 3 跳的夥伴後就有全部 9 個——數量每步變三倍,所以 ⌈log⁡3n⌉\lceil \log_3 n \rceil 步就夠。Juerss, Addanki and Schmid, SIGCOMM 2026, Figure 3 (camera-ready PDF, p. 7, re-rendered).

3.2 Bandwidth-optimal form and the congestion bill3.2 頻寬最佳的形式與壅塞的帳單

The bandwidth-optimal form splits the vector into nn blocks and runs a reduce-scatter, then an all-gather. In step kk, node rr sends each peer the blocks for that peer and for every node the peer reaches later: 3s−1−k3^{s-1-k} blocks, or m/3k+1m/3^{k+1} bytes, where s=log⁡3ns = \log_3 n. Lemma 4.1 sums both peers over one phase:

頻寬最佳的形式把向量切成 nn 個區塊,先跑 reduce-scatter,再跑 all-gather。第 kk 步,節點 rr 送給每個夥伴的是該夥伴、以及該夥伴之後會到達的每個節點的區塊:共 3s−1−k3^{s-1-k} 個區塊,即 m/3k+1m/3^{k+1} 位元組,其中 s=log⁡3ns = \log_3 n。Lemma 4.1 把兩個夥伴在一個階段內的量加總:

∑k=0s−12⋅m3k+1=m(1−3−s)=m(1−1n) \sum_{k=0}^{s-1} 2 \cdot \frac{m}{3^{k+1}} = m\left(1 - 3^{-s}\right) = m\left(1 - \frac{1}{n}\right)

So the two phases send the minimal 2m(1−1/n)2m(1 - 1/n) bytes in 2⌈log⁡3n⌉2\lceil \log_3 n \rceil steps. The cost model charges each step α\alpha plus βmkck\beta m_k c_k, with ckc_k the chunks that share a link. Both peers sit 3k3^k hops away, so every link carries exactly 3k3^k chunks. The payload falls by 3 as the load rises by 3, so the byte factor Θ\Theta (in units of mβm\beta) is 23log⁡3n\tfrac23 \log_3 n. Bruck's messages travel 3k3^k and 2⋅3k2 \cdot 3^k hops the same way, so its links carry three times as many chunks. The paper's Table 1 (model values):

所以兩個階段以 2⌈log⁡3n⌉2\lceil \log_3 n \rceil 步送出最少的 2m(1−1/n)2m(1 - 1/n) 位元組。成本模型對每一步收 α\alpha 加上 βmkck\beta m_k c_k,ckc_k 是共用一條鏈路的 chunk 數。兩個夥伴都隔 3k3^k 跳,所以每條鏈路恰好承載 3k3^k 個 chunk。酬載除以 3、負載乘以 3,所以位元組因子 Θ\Theta(以 mβm\beta 為單位)是 23log⁡3n\tfrac23 \log_3 n。Bruck 的兩則訊息往同一方向走 3k3^k 與 2⋅3k2 \cdot 3^k 跳,所以它的鏈路承載三倍的 chunk。論文的 Table 1(模型值):

Ring, two ports環,兩個埠Steps (B)步數 (B)Θ\Theta (B)Steps (L)步數 (L)Θ\Theta (L)
Ring環2(n−1)2(n-1)11——
Recursive doubling遞迴倍增2log⁡2n2\log_2 n12log⁡2n\tfrac12 \log_2 nlog⁡2n\log_2 nnn
Swing2log⁡2n2\log_2 n13log⁡2n\tfrac13 \log_2 nlog⁡2n\log_2 nn/3n/3
Bruck2⌈log⁡3n⌉2\lceil \log_3 n \rceil2log⁡3n2\log_3 n⌈log⁡3n⌉\lceil \log_3 n \rceil3n/23n/2
Trivance2⌈log⁡3n⌉2\lceil \log_3 n \rceil23log⁡3n\tfrac23 \log_3 n⌈log⁡3n⌉\lceil \log_3 n \rceiln/2n/2

(B) is the bandwidth-optimal form; (L), the latency-optimal form, forwards the whole vector in every step. The (L) columns show the trade-off: Trivance saves steps but puts 1.5 times Swing's byte load on the busiest links, so the winner depends on α\alpha against βm\beta m.

(B) 是頻寬最佳的形式;(L) 是延遲最佳的形式,每一步都轉送整個向量。(L) 欄呈現了取捨:Trivance 省下步數,但在最忙的鏈路上放了 Swing 1.5 倍的位元組負載,所以誰勝出取決於 α\alpha 與 βm\beta m 的大小。

3.3 Sizes that are not a power of three3.3 不是 3 的冪的大小

For other nn, Trivance runs ⌊log⁡3n⌋\lfloor \log_3 n \rfloor normal steps. In the last step both peers sit at distance ⌈(n−3⌊log⁡3n⌋)/2⌉\lceil (n - 3^{\lfloor \log_3 n \rfloor})/2 \rceil, just enough to cover the missing nodes. A 32-node ring knows 27 nodes before its last step and needs 5 more, while an 81-node ring would need 54. The step count stays ⌈log⁡3n⌉\lceil \log_3 n \rceil. Figure 2 shows the paper's Table 2.

對其他的 nn,Trivance 先跑 ⌊log⁡3n⌋\lfloor \log_3 n \rfloor 個一般步驟。最後一步兩個夥伴的距離是 ⌈(n−3⌊log⁡3n⌋)/2⌉\lceil (n - 3^{\lfloor \log_3 n \rfloor})/2 \rceil,剛好補齊缺少的節點。32 節點的環在最後一步前已知 27 個節點,只需再補 5 個;81 節點的環則需要 54 個。步數仍是 ⌈log⁡3n⌉\lceil \log_3 n \rceil。圖 2 呈現論文的 Table 2。

distance in each step每一步的距離next 3ᵏ, its last step下一個 3ᵏ 的最後一步last-step congestion vs next 3ᵏ最後一步壅塞,相對下一個 3ᵏn = 8139:3100.0%n = 1613427:944.4%n = 32139381:2711.1%n = 641391981:2770.4%
distance in each step每一步的距離next 3ᵏ, its last step下一個 3ᵏ 的最後一步last-step congestion vs next 3ᵏ最後一步壅塞,相對下一個 3ᵏn = 8139:3100.0%n = 1613427:944.4%n = 32139381:2711.1%n = 641391981:2770.4%
Figure 2. Peer distance in each step of Trivance for four ring sizes; the last step (orange) is shortened. Right: the last step's congestion relative to the last step of the next power of three. A 32-node ring pays 11% of an 81-node ring's last step, a 64-node ring 70%.圖 2。四種環大小下 Trivance 每一步的夥伴距離;最後一步(橘色)被縮短。右:最後一步的壅塞,相對於下一個 3 的冪的最後一步。32 節點的環只付出 81 節點環最後一步的 11%,64 節點的環則是 70%。Drawn for this primer from §4.4 and Table 2 of Juerss, Addanki and Schmid, SIGCOMM 2026 (model values).

Against ⌈log⁡2n⌉\lceil \log_2 n \rceil, the paper counts 25–57% more steps for Swing and recursive doubling at power-of-two sizes, up to 75% at other sizes, and 58.5% as nn grows (log⁡23≈1.585\log_2 3 \approx 1.585).

與 ⌈log⁡2n⌉\lceil \log_2 n \rceil 相比,論文算出:在 2 的冪的大小上,Swing 與遞迴倍增多出 25–57% 的步數,其他大小最多多出 75%,nn 變大時多出 58.5%(log⁡23≈1.585\log_2 3 \approx 1.585)。

3.4 Multidimensional tori3.4 多維環面

On a torus, Trivance runs one collective per dimension, each on 1/D1/D of the vector, mapped to distinct dimensions in every step; on a 9×9 torus the two collectives swap dimensions after each step. Messages get smaller and shorter. Table 3 gives the byte factor relative to the optimum mβ/Dm\beta/D; for Trivance (B) it is (3D−1)/(3D−3)(3^D - 1)/(3^D - 3) (Figure 3).

在環面上,Trivance 每個維度跑一個集體操作,各處理向量的 1/D1/D,每一步對應到不同的維度;在 9×9 環面上,兩個集體操作每一步都互換維度。訊息變小、距離變短。Table 3 給出相對最佳值 mβ/Dm\beta/D 的位元組因子;Trivance (B) 是 (3D−1)/(3D−3)(3^D - 1)/(3^D - 3)(圖 3)。

1%3%10%30%100%300%transmission delay above the optimum mβ/D (log scale)傳輸延遲高出最佳值 mβ/D 的比例(對數刻度)SwingTrivanceRec. doubling遞迴倍增BruckD = 21.21.331.54D = 31.041.081.173.25D = 41.011.021.073.06
1%3%10%30%100%300%transmission delay above the optimum mβ/D (log scale)傳輸延遲高出最佳值 mβ/D 的比例(對數刻度)SwingTrivanceRec. doubling遞迴倍增BruckD = 21.21.331.54D = 31.041.081.173.25D = 41.011.021.073.06
Figure 3. Byte factors of the bandwidth-optimal forms on 2D, 3D and 4D tori (Table 3, model values for large nn), drawn as the excess over the optimum on a log scale. The bucket algorithm is exactly optimal. In 3D and 4D Trivance is within 8% and 2%, while it keeps its smaller step count.圖 3。頻寬最佳形式在 2D、3D、4D 環面上的位元組因子(Table 3,nn 很大時的模型值),以對數刻度畫出高於最佳值的部分。bucket 演算法恰好最佳。在 3D 與 4D,Trivance 分別只高出 8% 與 2%,同時保有較少的步數。Drawn for this primer from §5 and Table 3 of Juerss, Addanki and Schmid, SIGCOMM 2026.

Panel 1 evaluates the model of Tables 1 and 3 for every ring or torus size and vector size.

面板 1 依 Table 1 與 Table 3 的模型,計算每一種環或環面大小與向量大小。

Panel 1面板 1

Fewer steps or less link load: who wins where, by the paper's model步數較少還是鏈路負載較輕:依論文的模型,誰在哪裡勝出

Steps, Trivance : Swing
步數,Trivance : Swing
Θ\Theta (L), Trivance : Swing
Θ\Theta (L),Trivance : Swing
Fastest at the outlined cell
框起格子中最快
Trivance fastest in this row up to
本列中 Trivance 最快直到

Model values only; the paper's simulated results are not shown. Each cell takes the smallest T=Kα+Θ mβ/DT = K\alpha + \Theta\, m\beta/D over nine algorithms: KK is the step count and Θ\Theta the byte factor of Table 1 (rings, D=1D = 1) or the large-nn forms of Table 3 (tori), with rounded-up logarithms for the steps. Solid cells are latency-optimal forms (L), half-transparent cells bandwidth-optimal ones (B). Bruck and recursive doubling never win in this model: they take as many steps as Trivance and Swing but have a larger Θ\Theta. Defaults: a 64-node ring with the paper's α=1.5\alpha = 1.5 µs and 800 Gb/s links; the model switches from Trivance (L) to (B) at about 20 KiB, to Swing (B) at about 1.1 MiB and to the ring at about 16 MiB. Raise α\alpha or the link rate: Trivance's region grows, because each saved step is worth more bytes. Switch to 3D: the byte factors approach 1, so the step count decides more cells. Compare neighboring rows such as 27 and 32: step counts change in jumps, so the regions do too. Table 3's forms are limits for large nn, so small tori are rough.

只有模型值;不顯示論文的模擬結果。每個格子從九種演算法中取最小的 T=Kα+Θ mβ/DT = K\alpha + \Theta\, m\beta/D:KK 是步數,Θ\Theta 是 Table 1(環,D=1D = 1)或 Table 3 大 nn 形式(環面)的位元組因子,步數的對數取上整數。實心格子是延遲最佳形式(L),半透明格子是頻寬最佳形式(B)。在這個模型中 Bruck 與遞迴倍增永遠不會勝出:它們的步數與 Trivance、Swing 相同,但 Θ\Theta 較大。預設值:64 節點的環、論文的 α=1.5\alpha = 1.5 µs 與 800 Gb/s 鏈路;模型約在 20 KiB 從 Trivance (L) 切到 (B),約 1.1 MiB 切到 Swing (B),約 16 MiB 切到環。提高 α\alpha 或鏈路速率:Trivance 的區域變大,因為每省下一步就相當於更多位元組。切到 3D:位元組因子趨近 1,所以更多格子由步數決定。比較相鄰的列,例如 27 與 32:步數是跳躍式變化,區域也跟著跳。Table 3 的形式是大 nn 時的極限,所以小環面只是粗估。

4. Implementation4. 實作

The authors implemented Trivance and Bruck in SST, a packet-level simulator, and took bucket, recursive doubling and Swing from Swing's public code, with recursive doubling extended to all ports. For a fair baseline they improved Bruck: shortest-path routing, joint reductions, and a reversed all-gather after NCCL's PAT algorithm. There is no implementation in a production library.

作者在封包層級模擬器 SST 中實作了 Trivance 與 Bruck,bucket、遞迴倍增與 Swing 則取自 Swing 公開的程式碼,並把遞迴倍增擴充為使用所有的埠。為了公平比較,他們改良了 Bruck:最短路徑繞送、聯合歸約,以及仿照 NCCL PAT 演算法的反向 all-gather。沒有在正式函式庫中的實作。

Appendix D (not peer-reviewed) sketches one: a backend schedule like PAT emits one work item per rank, step and chunk, with both peers, and a per-chunk readiness entry with two bits lets the reduction run only when both receives are done (Figure 4). A library should pick Trivance only if each dimension has two independent paths.

附錄 D(未經同儕審查)勾勒了一種實作:後端排程像 PAT 一樣,為每個 rank、步驟與 chunk 產生一個帶有兩個夥伴的工作項目,而每個 chunk 的就緒項目有兩個位元,兩個接收都完成後才執行歸約(圖 4)。函式庫應該只在每一維都有兩條獨立路徑時才選用 Trivance。

PAT step (one input)PAT 的一步(一個輸入)receive chunk c收到 chunk creduce with local與本地資料歸約send to next peer送給下一個夥伴Trivance step (two inputs)Trivance 的一步(兩個輸入)receive c from left從左邊收到 creceive c from right從右邊收到 cLRL ∧ Rboth bits set?兩個位元都設了?same buffer generation同一個緩衝區世代reduce local + left + right歸約 本地 + 左 + 右send to both peers送給兩個夥伴
PAT step (one input)PAT 的一步(一個輸入)receive chunk c收到 chunk creduce with local與本地資料歸約send to next peer送給下一個夥伴Trivance step (two inputs)Trivance 的一步(兩個輸入)receive c from left從左邊收到 creceive c from right從右邊收到 cLRL ∧ Rboth bits set?兩個位元都設了?same buffer generation同一個緩衝區世代reduce local + left + right歸約 本地 + 左 + 右send to both peers送給兩個夥伴
Figure 4. One chunk in a PAT step and in a Trivance step. Trivance's reduction waits for two receives, so a late input stalls the pair.圖 4。同一個 chunk 在 PAT 的一步與 Trivance 的一步中的流程。Trivance 的歸約要等兩個接收完成,所以一個輸入遲到就會拖住一對。Drawn for this primer from §7 and Appendix D of Juerss, Addanki and Schmid, SIGCOMM 2026.

5. What was evaluated5. 評估了什麼

The simulated network has 800 Gb/s links, 100 ns propagation, about 200 ns per hop, 8,192 B packets, a per-step latency α=1.5 μs\alpha = 1.5\,\mu\text{s}, 2D2D network interfaces per node with their own engines, credit-based flow control and shortest-path routing. The shapes are rings of 8 and 64 nodes, 2D tori 32×32, 8×64 and 27×27, and a 16×16×16 torus. Link rates range from 200 Gb/s to 3.2 Tb/s, and vectors from 32 B to 128 MiB. The baselines are bucket, recursive doubling, Swing and the improved Bruck, each in its better form. All of the paper's speedups and crossover sizes come from this simulation, so this page does not show them.

模擬的網路使用 800 Gb/s 鏈路、100 ns 傳播延遲、每跳約 200 ns、8,192 B 封包、每步延遲 α=1.5 μs\alpha = 1.5\,\mu\text{s},每節點 2D2D 個各有獨立引擎的網路介面,以及 credit-based 流量控制與最短路徑繞送。拓樸包括 8 與 64 節點的環、32×32、8×64、27×27 的二維環面,以及 16×16×16 的環面。鏈路速率從 200 Gb/s 到 3.2 Tb/s,向量從 32 B 到 128 MiB。比較基準是 bucket、遞迴倍增、Swing 與改良的 Bruck,各取較好的形式。論文所有的加速倍數與交叉點大小都來自這個模擬,所以本頁不列出。

The model alone gives crossovers. With Table 1, α=1.5 μs\alpha = 1.5\,\mu\text{s} and 800 Gb/s (100 GB/s) on a 64-node ring, one row per switch (our computation):

只靠模型也能算出交叉點。用 Table 1、α=1.5 μs\alpha = 1.5\,\mu\text{s} 與 800 Gb/s(100 GB/s),在 64 節點的環上,每列一個切換點(我們的計算):

Switch (64-node ring, model)切換(64 節點的環,模型)Calculation算式Result結果
Trivance (L) → (B): 4 more steps, Θ\Theta 32 → 2.52Trivance (L) → (B):多 4 步,Θ\Theta 32 → 2.524×1.5 μs×100 GB/s÷(32−2.52)4 \times 1.5\,\mu\text{s} \times 100\,\text{GB/s} \div (32 - 2.52)≈20\approx 20 KiB
Trivance (B) → Swing (B): 4 more steps, Θ\Theta 2.52 → 2Trivance (B) → Swing (B):多 4 步,Θ\Theta 2.52 → 24×1.5 μs×100 GB/s÷(2.52−2)4 \times 1.5\,\mu\text{s} \times 100\,\text{GB/s} \div (2.52 - 2)≈1.1\approx 1.1 MiB
Swing (B) → ring: 114 more steps, Θ\Theta 2 → 1Swing (B) → 環:多 114 步,Θ\Theta 2 → 1114×1.5 μs×100 GB/s÷(2−1)114 \times 1.5\,\mu\text{s} \times 100\,\text{GB/s} \div (2 - 1)≈16\approx 16 MiB

The simulator adds per-hop delay, packets and finite-size effects, so its crossovers differ from these.

模擬器另外包含每跳延遲、封包化與有限大小的效應,所以它的交叉點與這些值不同。

6. Limits and open questions6. 限制與未解的問題

The paper lists its limits (§7): simulation does not replace a library implementation; joint reduction needs stronger synchronization, and if one peer sends chunks in ascending order and the other in descending order, about half a message waits; Clos fabrics are future work; and using all 2D2D ports at once could reach ⌈log⁡2D+1n⌉\lceil \log_{2D+1} n \rceil steps only with very specific sizes. A careful reader should add:

論文列出了自己的限制(§7):模擬無法取代函式庫中的實作;聯合歸約需要更強的同步,若一個夥伴以遞增順序送 chunk、另一個以遞減順序送,大約半個訊息要等待;Clos 網路是未來的工作;同時使用全部 2D2D 個埠只有在非常特定的大小下才能達到 ⌈log⁡2D+1n⌉\lceil \log_{2D+1} n \rceil 步。細心的讀者還應該補上:

  • Power-of-two sizes are common. At 64 nodes the last step costs 70% of the 81-node case (Figure 2).2 的冪的大小很常見。64 個節點時,最後一步的成本是 81 節點情況的 70%(圖 2)。
  • Endpoint model. Each simulated interface injects on its own, with no node-wide limit. A GPU whose two streams share one NIC or PCIe path would serialize them.端點模型。每個模擬的介面各自注入,沒有全節點的上限。若 GPU 的兩條資料流共用一張 NIC 或同一條 PCIe 路徑,就會被串行化。
  • Reduction cost. The model leaves out γ\gamma, although each step reduces three operands. The paper notes that the reduced volume falls from about 2m2m to 1.5m1.5m.歸約成本。模型沒有包含 γ\gamma,雖然每一步要歸約三個運算元。論文指出歸約的總量從約 2m2m 降到 1.5m1.5m。
  • No straggler test, although joint reduction is more sensitive to a late input than independent copies.沒有 straggler 測試,雖然聯合歸約比獨立的副本更怕輸入遲到。

7. How it connects7. 與其他內容的關聯

  • Swing (NSDI 2024) is the direct predecessor: same simulator, same direct-connect setting, and the strongest baseline. Swing cuts distance; Trivance cuts steps.Swing(NSDI 2024)是直接的前作:相同的模擬器、相同的直連拓樸情境,也是最強的比較基準。Swing 削減距離;Trivance 削減步數。
  • Deep dive: Panel 4 (section 4) animates Trivance's peers; section 9.2 gives its step table.第 4 章:面板 4(第 4 節)以動畫呈現 Trivance 的夥伴;第 9.2 節給出它的步數表。
  • TPU v4 is the paper's target: 3D tori of up to 4,096 chips, where the 3D column of Table 3 applies.TPU v4 是論文的目標:最多 4,096 顆晶片的三維環面,正適用 Table 3 的 3D 欄。
  • Theseus, in the same SIGCOMM session, hot-swaps schedules at run time; a Trivance schedule could be one entry in its menu.Theseus 與本文同屬 SIGCOMM 的同一場議程,能在執行期熱抽換排程;Trivance 的排程可以是它選單中的一項。

Key numbers關鍵數字

Number數字Meaning (kind of value)意義(數值類型)
⌈log⁡3n⌉\lceil \log_3 n \rceilSteps of latency-optimal Trivance; the two-port lower bound (proof)延遲最佳 Trivance 的步數;兩埠的下限(證明)
≈ 37%Fewer steps than log⁡2n\log_2 n, as nn grows (analysis)nn 變大時比 log⁡2n\log_2 n 少的步數(分析)
3k3^k · 3×Chunks per link in step kk; Bruck's load relative to Trivance (analysis)第 kk 步每鏈路的 chunk 數;Bruck 相對 Trivance 的負載(分析)
n/2n/2 vs n/3n/3Θ\Theta of latency-optimal Trivance vs Swing (Table 1, model)延遲最佳 Trivance 與 Swing 的 Θ\Theta(Table 1,模型)
1.33 / 1.08 / 1.02Θ\Theta of Trivance (B) on 2D / 3D / 4D tori (Table 3, model)Trivance (B) 在 2D/3D/4D 環面的 Θ\Theta(Table 3,模型)
11.1% · 70.4%Last-step congestion of 32 and 64 nodes vs 81 (Table 2, model)32 與 64 節點最後一步相對 81 的壅塞(Table 2,模型)
800 Gb/s · 1.5 µsSimulated link rate and per-step latency (setup)模擬的鏈路速率與每步延遲(設定)

Terms used on this page本頁用到的術語

Joint reduction
Reducing both incoming messages of a step with the local partial result before forwarding.
在轉送前,把一步中收到的兩則訊息與本地部分結果一起歸約。
Bruck's algorithm
A two-port all-gather in log⁡3n\log_3 n steps, with peers at 3k3^k and 2⋅3k2 \cdot 3^k in one direction.
兩個埠下以 log⁡3n\log_3 n 步完成的 all-gather,夥伴在同一方向的 3k3^k 與 2⋅3k2 \cdot 3^k。
Byte factor Θ\Theta
The sum over steps of bytes sent times chunks per link, relative to mβm\beta (ring) or mβ/Dm\beta/D (torus).
各步送出的位元組乘以每鏈路 chunk 數之和,相對於 mβm\beta(環)或 mβ/Dm\beta/D(環面)。
(L) / (B) form
Latency-optimal: the whole vector in every step. Bandwidth-optimal: reduce-scatter plus all-gather with the minimal bytes.
延遲最佳:每步送整個向量。頻寬最佳:reduce-scatter 加 all-gather,位元組最少。
PAT
NCCL's Bruck-derived all-gather and reduce-scatter.
NCCL 由 Bruck 衍生的 all-gather 與 reduce-scatter。

Check your understanding檢驗你的理解