A new compiler called Mirage Persistent Kernel (MPK) transforms large language model (LLM) inference into a single, high-performance megakernel, significantly reducing latency by 1.2-6.7 times. By fusing computation and communication across multiple GPUs, MPK maximizes hardware utilization and enables efficient execution without the overhead of multiple kernel launches. The compiler is designed to be user-friendly, requiring minimal input to compile LLMs into optimized megakernels.