Harvest: Adaptive Photonic Switching Schedules for Collective Communication in Scale-up DomainsHarvest:在 scale-up 域中為集體通訊自適應安排光子交換的時程
After reading, you can explain when a photonic scale-up fabric should re-wire during one collective, how Harvest's dynamic program finds the steps, and why rings never gain.讀完後,你能說明光子 scale-up 網路在一次集體操作中何時該重新接線、Harvest 的動態規劃如何找出那幾步,以及為何環演算法永遠得不到好處。
A photonic circuit switch can give every pair of GPUs a direct optical path. Each change of circuits costs a reconfiguration delay : about 10 ns with tunable lasers, about 10 ms with 3-D MEMS mirrors. A collective runs in steps with known peers, and Harvest decides before which steps the circuits change. Its cost model is the α–β model plus propagation and congestion. A dynamic program picks the cut points, and a subproblem picks one topology for each run of steps. For recursive doubling the best topology for a run is the direct links of its first step, so no solver is needed; rings never gain from re-wiring. No photonic switch was used: the 8-GPU "hardware emulation" pauses NCCL between steps and adds a constant per reconfiguration. Measured: a per-hop of 30.32 µs and of 85.11 Gb/s, schedule synthesis within 20 µs up to 64 GPUs, and GPU synchronization of about 4 µs for 8 GPUs. All speedups are simulation, so this page teaches the model.
光子電路交換器可以讓每一對 GPU 都有一條直接的光路徑。每次改變電路都要付出重新配置延遲 :可調雷射約 10 ns,3-D MEMS 鏡片約 10 ms。集體操作分成數個步驟、每步的夥伴事先已知,Harvest 決定在哪幾步之前改變電路。它的成本模型是 α–β 模型再加上傳播延遲與壅塞。動態規劃挑選切點,子問題為每一段連續步驟挑選一個拓樸。對遞迴倍增而言,一段步驟的最佳拓樸就是其第一步的直接鏈路,所以不需要求解器;環演算法則永遠不會因重新接線而受益。論文沒有用到任何光子交換器:8 GPU 的「硬體模擬」在步驟之間暫停 NCCL,並為每次重新配置加上一個常數。實測的是:每跳 為 30.32 µs、 為 85.11 Gb/s,64 顆 GPU 以內的排程合成在 20 µs 內完成,8 顆 GPU 的同步約 4 µs。所有加速倍數都來自模擬,所以本頁教的是模型。
1. Where this paper sits1. 這篇論文的位置
The Chapter 4 (section 2, Panel 2) prices a collective as per dependent step plus bytes over bandwidth. The ring takes steps and sends the fewest bytes; recursive doubling takes steps and sends more. Both formulas assume that peers talk at full rate. On a fixed ring this is false for recursive doubling: in step the peers are hops apart, so flows share each link. Harvest adds a third option: change the wiring.
第 4 章(第 2 節,面板 2)把一次集體操作的成本算成每個相依步驟一個 ,再加上位元組除以頻寬。環要 步、送出的位元組最少;遞迴倍增只要 步,但送得較多。兩條公式都假設夥伴之間以全速通訊。在固定的環上,這對遞迴倍增並不成立:第 步的夥伴相隔 跳,所以每條鏈路上有 條流共用。Harvest 加入第三種選擇:改變接線。
The Chapter 6 (section 5, Panel 5) shows TPU v4, where optical circuit switches (OCS) re-wire a torus once per job. Two digests of this chapter re-wire during training, in milliseconds, in the scale-out network: MixNet inside each MoE layer and Opus between parallelism phases. Harvest works inside one collective, in a scale-up domain of 8 to 64 GPUs, where photonic switches can change in nanoseconds to microseconds.
第 6 章(第 5 節,面板 5)介紹 TPU v4:光電路交換器(OCS)每個任務重新接線一次環面。本章另有兩篇導讀在訓練進行中、在 scale-out 網路裡以毫秒級重新接線:MixNet 在每個 MoE 層內,Opus 在平行化階段之間。Harvest 則在單一次集體操作內運作,範圍是 8 到 64 顆 GPU 的 scale-up 域,那裡的光子交換器可以在奈秒到微秒內切換。
What was missing. Earlier circuit schedulers decompose an aggregate traffic matrix and assume that all of its demand is available at once, or they ignore . In a collective, the data of step exists only after step . Topology-aware algorithms (Swing, Bruck) and collective synthesis (TE-CCL) fix the topology and search the schedule. Harvest is the converse: it fixes the schedule and searches a topology for each step.
過去缺少什麼。先前的電路排程器把總流量矩陣拆解,並假設其中所有需求同時就緒;或是乾脆忽略 。在集體操作中,第 步的資料要等第 步完成才存在。拓樸感知演算法(Swing、Bruck)與集體操作合成(TE-CCL)固定拓樸、搜尋排程。Harvest 正好相反:固定排程,為每一步搜尋拓樸。
2. The problem, in the paper's example2. 問題:論文的例子
The paper has no measurement study. Its motivation is a worked example (§3.2): recursive doubling on 8 GPUs, in the cyclic variant where GPU sends to GPU in step .
論文沒有量測研究,它的動機是一個算例(§3.2):8 顆 GPU 上的遞迴倍增,採循環版本,在第 步 GPU 送給 GPU 。

If the circuits change before step 2 to join GPUs two apart, step 2 has congestion 1 and step 3 has 2. A second change before step 3 makes every step direct. The paper's Table 1 compares the three schedules, relative to the best:
如果在第 2 步之前把電路改成連接相隔兩個的 GPU,第 2 步的壅塞變成 1,第 3 步為 2。在第 3 步之前再改一次,每一步都變成直接連線。論文的 Table 1 比較這三種排程(相對於最佳值):
| Circuits in steps 1, 2, 3第 1、2、3 步的電路 | Congestion壅塞 | Propagation傳播 | Reconfigurations重新配置 |
|---|---|---|---|
| (static)(靜態) | 4× | 4× | 0 |
| 2× | 2× | 1 | |
| (every step)(每一步) | 1× | 1× | 2 |
Re-wiring before every step is a BvN schedule. It wins when is small; the static ring wins when is large. Harvest is about the schedules between them.
每一步之前都重新接線稱為 BvN 排程。 小時它勝出; 大時靜態環勝出。Harvest 處理的是兩者之間的排程。
3. The design3. 設計
3.1 The cost of one step on one topology3.1 一個步驟在一個拓樸上的成本
Step moves bytes along the pattern , a 0/1 matrix of who sends to whom, on topology . The maximum concurrent flow is the largest fraction of the step's demand that the links carry at the same time, so is the congestion. The step's demand completion time is (Eq. 3)
第 步在拓樸 上依模式 (記錄誰送給誰的 0/1 矩陣)搬運 位元組。最大並行流 是鏈路能同時承載的該步需求的最大比例,所以 就是壅塞。該步的需求完成時間是(Eq. 3)
Here is the per-step setup latency, the propagation delay of one link, the longest path through the most congested links, and for link capacity . With and this is Chapter 6's α–β model (Observation 2). The collective costs (Eq. 4)
其中 是每步的啟動延遲, 是一條鏈路的傳播延遲, 是經過最壅塞鏈路的最長路徑,, 是鏈路容量。當 且 ,這就是第 6 章的 α–β 模型(Observation 2)。整個集體操作的成本是(Eq. 4)
The last term charges whenever the link set changes. In point-to-point algorithms each is a permutation, so a collective is a Birkhoff–von Neumann (BvN) decomposition of its total demand, with an order fixed by data dependencies (Observation 1).
最後一項在鏈路集合 改變時收取 。在點對點演算法中每個 都是排列,所以一次集體操作就是其總需求的 Birkhoff–von Neumann(BvN)分解,只是順序由資料相依性固定(Observation 1)。
3.2 One topology for a run of steps3.2 為一段連續步驟選一個拓樸
The subproblem takes steps to with no re-wiring inside and finds the one topology that minimizes their summed time (Eqs. 5–6). Appendix A writes it as a mixed-integer second-order cone program (MISOCP). An integer counts links from to , at most per node; each step's flows carry of its demand within capacity ; and time obeys , a cone constraint. The cone appears because one topology serves several demands one after another; with all demand at once it would be a linear program. The MISOCP is solvable up to about 64 GPUs. The evaluation restricts candidates to shifted rings, an expander, shifted tori and the per-step matchings, which removes the integers.
子問題取第 到第 步、中間不重新接線,找出使這些步驟總時間最小的單一拓樸 (Eqs. 5–6)。附錄 A 把它寫成混合整數二階錐規劃(MISOCP)。整數 計算從 到 的鏈路數,每個節點最多 條;每一步的流在容量 之內承載該步需求的 ;時間滿足 ,這是一個錐限制。錐的出現是因為同一個拓樸要先後服務好幾個需求;若所有需求同時存在,它就只是線性規劃。MISOCP 可解到約 64 顆 GPU。評估時把候選限制為平移環、一個擴展圖、平移環面與各步的配對,於是整數變數消失。
3.3 When to re-wire: a dynamic program3.3 何時重新接線:動態規劃
is the best time from step to the end with exactly reconfigurations, without . Lemma 1 splits at the first reconfiguration :
是從第 步到最後、恰好 次重新配置的最佳時間,不含 。Lemma 1 在第一次重新配置的位置 切開:
is the same for every change, so Theorem 1 adds it at the end:
每次改變的 都相同,所以 Theorem 1 在最後才把它加上:
The schedule is optimal for the given algorithm. The cost is , where is one subproblem. Schedules are computed offline and cached, off the critical path.
對給定的演算法,這個排程是最佳的。成本是 , 是一個子問題的成本。排程離線計算並快取,不在關鍵路徑上。
3.4 Recursive doubling and rings in closed form3.4 遞迴倍增與環的封閉形式
For recursive doubling two observations remove the solver (§5). Observation 3: direct links for step keep every later step connected, because the peer at distance is hops along them. Observation 4: for steps to , the best topology is the direct links of step ; later steps take 2, 4, … hops with equal congestion, the minimum. With bytes in step (reduce-scatter; the all-gather mirrors it), a run costs (Eq. 8)
對遞迴倍增,兩個觀察讓求解器變得多餘(§5)。Observation 3:為第 步建立的直接鏈路讓之後每一步都保持連通,因為距離 的夥伴沿這些鏈路走 跳就到。Observation 4:對第 到第 步,最佳拓樸是第 步的直接鏈路;之後的步驟走 2、4、… 跳,壅塞相同,都是最小值。第 步送 位元組時(reduce-scatter;all-gather 是它的鏡像),一段步驟的成本是(Eq. 8)
Each run is then , and synthesis is . Appendix B proves the same for hypercube all-to-all, Bruck's algorithms, binomial-tree broadcast and Trivance. Appendix C.1 gives the rule: a cyclic pattern whose distance grows geometrically. A ring algorithm uses the same ring in every step, so the observations make the static ring optimal (Appendix C.2): rings never gain from re-wiring. They pay with their number of steps instead.
於是每一段都是 ,合成是 。附錄 B 對 hypercube all-to-all、Bruck 的各演算法、二項樹廣播與 Trivance 證明了同樣的性質。附錄 C.1 給出規則:循環模式 ,且距離呈等比成長。環演算法每一步都用同一個環,所以這些觀察使靜態環成為最佳(附錄 C.2):環永遠不會因重新接線而受益,它付出的代價是步數。
Appendix C of the accepted version works this out for an all-gather on 64 GPUs: 6 steps of recursive doubling against 63 ring steps, with MB, ns, ns and 800 Gb/s. At µs the optimum re-wires twice. In the step order of Eq. 8 the runs are step 1, steps 2–3 and steps 4–6. The arithmetic, one question per row:
正式版附錄 C 以 64 顆 GPU 的 all-gather 算出這件事:遞迴倍增 6 步對環的 63 步, MB、 ns、 ns、800 Gb/s。 µs 時最佳排程重新接線兩次。依 Eq. 8 的步驟順序,三段是第 1 步、第 2–3 步與第 4–6 步。逐列計算如下:
| Question問題 | Calculation算式 | Result結果 |
|---|---|---|
| : 4 MB at 800 Gb/s (100 GB/s):4 MB、800 Gb/s(100 GB/s) | µs | |
| Run 1: step 1 on its direct links第 1 段:第 1 步,用自己的直接鏈路 | µs | |
| Run 2: steps 2–3 on distance-2 links第 2 段:第 2–3 步,用距離 2 的鏈路 | µs | |
| Run 3: steps 4–6 on distance-8 links第 3 段:第 4–6 步,用距離 8 的鏈路 | µs | |
| Two reconfigurations兩次重新配置 | µs | |
| Total總計 | µsTable 1: 73,357.95 nsTable 1:73,357.95 ns |
A smaller re-wires more often: 5 times at 10 ns (44.64 µs) and 4 times at 1 µs (49.29 µs). The ring algorithm needs 75.94 µs and recursive doubling on the static ring 131.98 µs. Our implementation of Eq. 8 and the dynamic program reproduces every Table 1 value within 1 ns. Figure A shows where it cuts.
越小,重新接線越頻繁:10 ns 時 5 次(44.64 µs),1 µs 時 4 次(49.29 µs)。環演算法需要 75.94 µs,靜態環上的遞迴倍增需要 131.98 µs。我們依 Eq. 8 與動態規劃實作的模型,重現 Table 1 每個值的誤差都在 1 ns 以內。圖 A 畫出它切在哪裡。
Figure B splits the same schedules into the four terms of Eq. 4. It shows why each loser loses.
圖 B 把同樣的排程拆成 Eq. 4 的四項,說明每個輸家輸在哪裡。
The panel runs Eq. 8 and the dynamic program for every message size and . Its defaults are the measured testbed values.
下面的面板對每一種訊息大小與 執行 Eq. 8 與動態規劃。預設值是實測的測試平台數值。
4. Implementation4. 實作
The synthesizer is C++ and calls Gurobi for the cone subproblems. The authors extended the packet-level simulator Astra-Sim to follow a reconfiguration schedule and released both (github.com/STyGIANet/Harvest).
合成器以 C++ 寫成,錐子問題交給 Gurobi 求解。作者擴充封包層級模擬器 Astra-Sim,使它能依重新配置排程運作,並公開了兩者(github.com/STyGIANet/Harvest)。
The "hardware emulation" connects 8 GPUs in a ring through 8 BlueField-3 NICs with 100 Gb/s optical transceivers. GPUs reach their NICs by GPUDirect RDMA over PCIe, and the NICs route in the BlueField-3 eSwitch with hardware flow steering. NCCL runs the collective one step at a time. At each planned reconfiguration, execution pauses, the configuration is updated, and execution resumes. The reported time is the sum of the measured step times plus a fixed penalty for each reconfiguration. Nothing ran on a photonic switch: in every result, the reconfiguration delay is a constant that the authors add. There is no end-to-end training system.
「硬體模擬」用 8 張 BlueField-3 NIC 與 100 Gb/s 光模組把 8 顆 GPU 接成一個環。GPU 透過 PCIe 上的 GPUDirect RDMA 連到 NIC,NIC 之間在 BlueField-3 eSwitch 中以硬體 flow steering 轉送。NCCL 一次執行集體操作的一步。到了每個預定的重新配置點,執行暫停、更新配置、再繼續。回報的時間是實測各步時間的總和,加上每次重新配置一個固定的懲罰值。沒有任何東西在光子交換器上執行:每個結果中的重新配置延遲,都是作者加上去的常數。也沒有端到端的訓練系統。
5. What was measured5. 量測了什麼
Setup (§6.1): 8 to 64 GPUs with 2 to 6 ports each; 800 Gb/s per port in simulation, 100 Gb/s in the emulation; , and swept from 10 ns to 10 ms. Baselines are static topologies (ring, 2-D and 3-D tori, generalized Kautz graphs) and BvN schedules. The collectives are recursive doubling, Swing and Bruck all-reduce, direct and Bruck all-to-all, and tree broadcasts. The paper's speedups over both baselines come from packet simulation, numerical optimization and the emulation with an added delay, so this page does not list them.
設定(§6.1):8 到 64 顆 GPU,每顆 2 到 6 個埠;模擬中每埠 800 Gb/s,模擬硬體中 100 Gb/s;、 與 從 10 ns 掃到 10 ms。基線是靜態拓樸(環、二維與三維環面、廣義 Kautz 圖)與 BvN 排程。集體操作包括遞迴倍增、Swing 與 Bruck all-reduce,直接與 Bruck all-to-all,以及樹狀廣播。論文對兩種基線的加速倍數來自封包模擬、數值最佳化與加上延遲的硬體模擬,所以本頁不列出。
Three things were measured. First, the authors fitted the α–β model to single-hop GPU-to-GPU transfers on the testbed:
實際量測的有三件事。第一,作者用測試平台上單跳 GPU 對 GPU 的傳輸擬合 α–β 模型:

This is about 60 times the 500 ns used in simulation, so the emulated regime is not the target regime. Second, the run time of the recursive-doubling dynamic program; third, the time for GPUs to synchronize through a shared-memory array before a step. Larger systems are emulated with more array entries and threads.
這個 約是模擬所用 500 ns 的 60 倍,所以模擬硬體所處的區間並不是目標區間。第二是遞迴倍增動態規劃的執行時間;第三是 GPU 在每步之前透過共享記憶體陣列同步所需的時間。更大的系統以更多陣列項目與執行緒來模擬。

| Quantity項目 | Setup設定 | Measured實測值 |
|---|---|---|
| Per-hop , 每跳 、 | 8 GPUs, BlueField-3 ring, 100G, NCCL8 顆 GPU、BlueField-3 環、100G、NCCL | 30.32 µs · 85.11 Gb/s |
| Schedule synthesis排程合成 | dynamic program, up to 64 / 1,024 GPUs動態規劃,至多 64 / 1,024 顆 GPU | ≤ 20 µs · < 35 µs |
| GPU synchronizationGPU 同步 | shared-memory array, 8 / 256 GPUs共享記憶體陣列,8 / 256 顆 GPU | ≈ 4 µs · < 45 µs |
Both overheads are tens of microseconds at most. They matter only where is also that small.
兩項開銷最多都只有數十微秒。只有在 也同樣小的區間,它們才有影響。
6. Limits and open questions6. 限制與未解的問題
The paper's own list (Appendix C.4): the schedule is optimal for one algorithm, not across algorithms. Jobs that share a switch whose reconfiguration touches all ports are not handled. Point-to-point traffic, such as pipeline sends that overlap a collective, is not modelled; the authors suggest a side electrical network, a static ring on one link pair per GPU, or joint optimization. Scale-out integration is future work. And is one constant, while a real change includes optical rise and fall, electrical or thermal switching, the control plane, synchronization, transceiver re-locking and routing updates.
論文自己列出的(附錄 C.4):排程只對一個演算法最佳,不是跨演算法最佳。若多個任務共用一台重新配置時會影響所有埠的交換器,這種情況沒有處理。點對點流量(例如與集體操作重疊的管線傳送)沒有建模;作者建議加一個旁路電子網路、用每顆 GPU 的一對鏈路組成靜態環,或聯合最佳化。與 scale-out 網路的整合留待未來。還有, 是單一常數,而真實的一次改變包含光的上升與下降時間、電或熱的切換時間、控制平面、同步、光模組重新鎖定與路由更新。
A careful reader adds four points. (1) Measured end-to-end times today sit far outside the region where Harvest re-wires. (2) The model needs GPUs with built-in cut-through routers, as in TPU ICI; NVLink GPUs do not forward for each other this way. (3) "Optimal" is relative to the candidate set used in the evaluation. (4) The only measured parameters come from a NIC-based ring whose is 30 µs, not from photonic hardware.
細心的讀者還會補上四點。(1) 今天實測的端到端時間,遠落在 Harvest 會重新接線的區間之外。(2) 模型需要內建 cut-through 路由器的 GPU,如 TPU 的 ICI;NVLink GPU 並不以這種方式替彼此轉送。(3)「最佳」是相對於評估所用的候選集合。(4) 唯一實測的參數來自以 NIC 組成、 為 30 µs 的環,而不是光子硬體。
7. How it connects7. 與其他內容的關聯
- Chapter 4, section 2: Harvest adds , and to the α–β model and its ring-versus-doubling crossover.第 4.3 節:Harvest 在 α–β 模型及其環與倍增的交叉點上,加入 、 與 。
- Chapter 6, section 5, and the TPU v4 reading: an OCS re-wires once per job; Harvest re-wires between the steps of one collective.第 6.9 節與 TPU v4 導讀:OCS 每個任務重新接線一次;Harvest 在一次集體操作的步驟之間重新接線。
- MixNet and Opus: millisecond OCS in scale-out. Opus's degree-2 circuits restrict it to rings, which by Appendix C.2 gain nothing from re-wiring.MixNet 與 Opus:scale-out 中的毫秒級 OCS。Opus 的度數 2 電路只能跑環,而依附錄 C.2,環不會因重新接線而受益。
- ZCube and BST: the static electrical answers of this chapter.ZCube 與 BST:本章的靜態電子網路答案。
- Swing and Trivance shorten distances on a fixed torus; TE-CCL searches schedules on a fixed topology, the converse problem.Swing 與 Trivance 在固定環面上縮短距離;TE-CCL 在固定拓樸上搜尋排程,是相反的問題。
Key numbers關鍵數字
| Number | 數字 | Meaning (setup, kind of value) | 意義(設定、數值類型) |
|---|---|---|---|
| 30.32 µs · 85.11 Gb/s | Per-hop and ; 8 GPUs, BlueField-3 ring, 100G (measured) | 每跳 與 ;8 顆 GPU、BlueField-3 環、100G(實測) | |
| ≈ 4 µs · < 45 µs | GPU synchronization, 8 / 256 GPUs (measured; 256 emulated with threads) | GPU 同步,8 / 256 顆(實測;256 顆以執行緒模擬) | |
| ≤ 20 µs · < 35 µs | Recursive-doubling synthesis, up to 64 / 1,024 GPUs (measured run time) | 遞迴倍增排程合成,至多 64 / 1,024 顆 GPU(實測執行時間) | |
| 44,638 · 49,293 · 73,358 ns | Optimum at = 10 ns / 1 µs / 10 µs; 64 GPUs, 4 MB all-gather (analysis, Table 1) | = 10 ns / 1 µs / 10 µs 的最佳值;64 顆 GPU、4 MB all-gather(分析,Table 1) | |
| 75,938 · 131,979 ns | Ring algorithm; recursive doubling on the static ring (analysis, Table 1) | 環演算法;靜態環上的遞迴倍增(分析,Table 1) | |
| · | Synthesis cost for recursive doubling / in general (analysis) | 遞迴倍增 / 一般情況的合成成本(分析) | |
| 10 ns – 10 ms · ≈ 64 | range swept; largest GPU count for the MISOCP (setup) | 掃描的 範圍;MISOCP 可解的最大 GPU 數(設定) |
Terms used on this page本頁用到的術語
- Scale-up domain
- The GPUs joined by the fast fabric inside a server or rack; Harvest assumes a photonic one of 8–64 GPUs.
- 伺服器或機櫃內由高速網路相連的 GPU;Harvest 假設是 8–64 顆 GPU 的光子網路。
- Reconfiguration delay
- The time to change the circuits; 10 ns (tunable lasers) to 10 ms (3-D MEMS) in the paper.
- 改變電路所需的時間;論文中從 10 ns(可調雷射)到 10 ms(3-D MEMS)。
- Step
- One round of a collective in which every GPU exchanges data with known peers.
- 集體操作中的一輪,每顆 GPU 與事先已知的夥伴交換資料。
- BvN decomposition / BvN schedule
- A demand written as a weighted sum of permutations; re-wiring before every step to match each one.
- 把需求寫成排列的加權和;每一步之前都重新接線以配合其排列。
- Maximum concurrent flow
- The largest fraction of all demands that the links carry at once; congestion is .
- 鏈路能同時承載的所有需求的最大比例;壅塞為 。
- MISOCP
- Mixed-integer second-order cone program; Harvest's form of the best-topology subproblem.
- 混合整數二階錐規劃;Harvest 用來表達最佳拓樸子問題的形式。
- Cut-through forwarding
- An intermediate GPU forwards data before the whole message has arrived.
- 中間的 GPU 在整則訊息到齊之前就開始轉送資料。
- Topology synthesis
- Choosing a topology per step for a fixed schedule; collective synthesis is the converse.
- 為固定的排程逐步選擇拓樸;集體操作合成則相反。