SearcharxivSearch

arXiv · 2509.16443

LightCode: Compiling LLM Inference for Photonic-Electronic Systems

Abstract

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Ryan Tomich, Zhizhen Zhong, Dirk Englund. 2025-09-19. LightCode: Compiling LLM Inference for Photonic-Electronic Systems. https://arxiv.org/abs/2509.16443

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Janus Dipoles: Fundamentals, Realizations, and Emerging Applications

The Janus dipole - featuring orthogonally oriented electric and magnetic dipoles with a 90-degree phase difference - has emerged as a powerful paradigm for wave manipulation. Unlike traditional Huygens dipoles used for directional control, this unique configuration exhibits strongly asymmetric, face-selective near-field behavior while maintaining a quasi-isotropic far-field radiation pattern. These remarkable properties make the Janus dipole an essential platform for directional wave shaping, with wide-ranging applications in on-chip photonics, quantum interactions, and wireless power transfer. This review systematically traces the rapid development of the Janus dipole from its foundational theoretical inception to its diverse implementation platforms across optical, microwave, and acoustic frequencies. In this paper, we explore the governing principles, classify realization strategies into passive Janus dipoles, active Janus dipoles, and advanced near-field coupling control, and highlight emerging frontiers. By bridging foundational electrodynamics with advanced device engineering, this paper serves as an essential reference and roadmap for researchers designing next-generation, highly integrated, and compact wave-manipulation systems.

physics.app-ph

Scattering-robust Imaging of Azimuthal Features with Enhanced Resolution

Imaging through scattering media remains a long-standing challenge in numerous real-world applications, ranging from medical imaging to long-distance sensing. Recently, illumination consisting of a single orbital angular momentum (OAM) mode, which is structured in the azimuthal coordinate, has been shown to provide enhanced resolution for imaging objects with azimuthal features, with the resolution becoming maximum at an optimal OAM value. However, in the presence of scattering, single-mode fields, which are spatially fully coherent, cause the imaging resolution to decrease significantly due to speckle formation. In this work, we employ azimuthally partially coherent fields and experimentally demonstrate imaging of azimuthal features with enhanced resolution in the presence of scattering. We show that lower degree of azimuthal coherence in such illumination leads to increased robustness against scattering while the azimuthal structure of the illumination ensures enhanced resolution. We derive the condition for best imaging resolution, and we report increase of imaging contrast in scattering from about 7% to 50% as the illumination is changed from a single-mode fully coherent field to that of an azimuthal partially coherent field.

physics.app-ph

Influence of magnetic fields on the performance of spin-orbit torque magnetic random-access memory

Spin-orbit torque magnetic random-access memory (SOT-MRAM) offers high speed, ultrahigh endurance, and compatibility with advanced semiconductor processes, making it a promising candidate for next-generation nonvolatile memory. However, intrinsic bias fields in magnetic tunnel junctions (MTJs), originating from reference-layer stray fields and interlayer coupling, cause asymmetric critical switching currents and increased energy consumption. Existing compensation approaches usually introduce additional magnetic layers into the MTJ stack, which increases fabrication complexity and limits wafer-scale integration. Here, we propose a bias-compensation strategy without modifying the MTJ stack by engineering local stray magnetic fields through magnetic filling materials in vertical interconnect access (VIA) channels during the back-end-of-line process. Micromagnetic simulations show that the proposed magnetic filling layer can provide the required auxiliary field for deterministic switching and significantly suppress write-current asymmetry. By optimizing the MTJ position relative to the magnetic filling structure, the write-current bias ratio is reduced from 21.6% in the conventional design to 1.3%. The approach is also applicable to in-plane magnetic anisotropy SOT-MTJs, reducing the bias ratio from 19.8% to -0.2%. Scaling analysis further demonstrates that the compensation effect remains effective when the device size is reduced to 20% of the original dimension (MTJ diameter approximately 10 nm), indicating its potential for high-density SOT-MRAM integration.

physics.app-ph