Search papers, labs, and topics across Lattice.
To resolve device memory bottlenecks and automatic differentiation overheads in photonic inverse design, the authors developed TorchFDTD, an open-source FDTD solver that pairs fused CUDA kernels with discrete adjoint transpose updates. The framework overcomes single-GPU limits by combining CUDA graph execution with causal host-memory streaming and time-reversal state reconstruction for full-wave derivative tracking. On benchmark suites, TorchFDTD runs 9.0–17.1× faster than prior PyTorch-based FDTD tools, reduces peak VRAM allocation by up to 65%, and enables gradient-based optimization of 54-million-cell photonic devices on a single workstation GPU.
Photonic inverse design across tens of millions of parameters no longer requires high-performance computing clusters, achieving full-wave 3D discrete adjoint sensitivity on a single commodity GPU via host-streamed causal slab updates.
Gradient-based photonic design needs full-wave derivatives with respect to millions of parameters, but on a single GPU workstation the time-domain adjoint is limited by device memory and by the incompatibility of fused update kernels with automatic differentiation. Here, we present TorchFDTD, an open-source finite-difference time-domain (FDTD) package that addresses both limits. Its Yee, absorber and dispersion updates execute as fused CUDA kernels captured in a CUDA graph, and every kernel is paired with a transpose kernel derived from its update, so material and geometry derivatives are obtained by a discrete adjoint that PyTorch chains with differentiable objectives built from the supported observations. The adjoint recovers forward states by checkpoint replay or, for lossless periodic problems, by time reversal. For problems that exceed the device, a streamed mode advances the domain one causal slab at a time and keeps the global state and the checkpoints in host memory, which lowers the device allocation while preserving the resident discretization. We validate the package against analytic solutions, against Meep, FDTDX and a rigorous coupled-wave solver, and against automatic differentiation and finite differences. On an A100 the fused path completes full forward solves of eight test scenes 9.0 to 17.1 times faster than the PyTorch FDTD package it extends, and its double-precision solves are 49 to 59 times faster than those of Meep on a workstation CPU. On an RTX 3060, host streaming of $256^3$ and $320^3$ adjoints costs 3.1 and 2.7 times the resident time and lowers the peak device allocation by 56% and 65%. A 54-million-cell pillar-array lens coupled to an angular-spectrum objective yields an adjoint derivative within 0.78% of a central difference. The time-domain adjoint of a device with tens of millions of cells thus becomes available on a single workstation GPU.