#Sequence Parallelism
-
· 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.