#Compilation
-
· 14 min read · reads
Cold Compile Optimization, Part 3: Cross-Rank Reuse for Sequence-Parallel Buckets, 48 Minutes to 17.7
After Hy4 turned on mixed-step sequence parallelism and raised the per-step token budget (max_num_batched_tokens, mnbt) to 8192 to cut time to first token, its cold compile climbed from about 14 minutes back to 48. The root cause: the sequence-parallel slice wrote the rank index into the traced graph. Each of the 16 ranks traced a different program, every rank rejected the others' compiled artifacts, and each rank compiled all five sequence-parallel buckets one after another. Reading the rank at run time from one in-group all_to_all brought cold compile to 18.7 minutes; staggering the sampler-side precompile across ranks and moving artifact saving to a background thread brought it to 17.7, on par with the same recipe without sequence parallelism.
-
· 12 min read · reads
Cold Compile Optimization, Part 2: Cross-DP Compile Reuse for Data-Parallel Deployments on TPU
The cross-rank replay described in the previous post only looks for reusable compiled artifacts within the same DP index. In a pure data-parallel deployment each inference engine has a DP index of its own, so replay never happens. We widened replay to search across DP indices, and for layouts that mix tensor and data parallelism we normalized the process group names in the graph fingerprint. On our self-maintained branch with the same image, the time from weights loaded to service ready dropped from 741 s to 270 s for Qwen3.5 DP8, and from 703 s to 251 s for TP2×DP4.
-
· 15 min read · reads
95 Minutes to 14: Cold Compile Optimization for Hy4 on TPU v7
TPU programs are compiled per input shape, and with an empty cache Hy4 took 95 minutes to start on TPU v7. Our analysis found that most of the cost was not in the compiler but in the computation graphs fed to it: one grew linearly with the bucket, the other with the number of ranks. After removing both multipliers and letting ranks replay each other's compiled artifacts, cold compile dropped to about 14 minutes. This post covers the analysis, the changes, the gains, the validation before production, and where these methods apply.