LightCode让大模型推理在光电混合系统中更省电更快。
LightCode: Compiling LLM Inference for Photonic-Electronic Systems

- 用堆叠图表示张量操作,智能分配光电资源
- 模拟显示能效最高降50%,延迟降低超10倍
- 适合研究光电融合加速器的开发者
大语言模型(LLMs)对低延迟、低功耗推理的需求推动了异构架构的发展。尽管GPU仍占主导,但难以与新兴的光子张量单元(PTUs)等专用加速器集成,后者可实现低功耗、高吞吐的线性计算。为此,我们提出LightCode,一个用于将LLM推理工作负载映射到光电混合系统的编译框架与仿真工具。LightCode引入堆叠图作为中间表示,编码每种张量操作的多种硬件实现。硬件分配被建模为受约束的子图选择问题,基于参数化成本模型优化延迟或能耗。我们在GPT-2和Llama-7B的预填充阶段进行评估,结果表明:(i)在最大序列长度下,光子硬件使能耗最多降低50%;(ii)多路复用与分配策略使延迟改善超过10倍;(iii)优化目标不同会导致截然不同的硬件映射方案。LightCode提供了一个模块化框架与仿真器,支持将大模型编译至新兴光子加速器。
原文摘要 · Abstract (English)
The growing demand for low-latency, energy-efficient inference in large language models (LLMs) has catalyzed interest in heterogeneous architectures. While GPUs remain dominant, they are poorly suited for integration with emerging domain-specific accelerators like the Photonic Tensor Units (PTUs), which offer low-power, high-throughput linear computation. This motivates hybrid compilation strategies that combine photonic and electronic resources. We present LightCode, a compiler framework and simulator for mapping LLM inference workloads across hybrid photonic-electronic systems. LightCode introduces the Stacked Graph, an intermediate representation that encodes multiple hardware-specific realizations of each tensor operation. Hardware assignment is formulated as a constrained subgraph selection problem optimized for latency or energy under parametric cost models. We evaluate LightCode on the prefill stage of GPT-2 and Llama-7B showing that under our workload and hardware assumptions, (i) Photonic hardware reduced energy by up to 50% in our simulated workloads at maximum sequence length; (ii) multiplexing and assignment strategy yielded latency improvements exceeding 10x; and (iii) Optimizing for latency or energy resulted in distinct hardware mappings in our simulations. LightCode offers a module, foundational framework and simulator for compiling LLMs to emerging photonic accelerators.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。