TorchSim is a novel PyTorch-based molecular dynamics engine designed to facilitate small- to medium-scale atomistic simulations by integrating machine-learned interatomic potentials (MLIPs) with the computational efficiency of GPUs. It provides a modular framework with components such as state management, MLIP interfaces, simulation runners, and trajectory tracking, all built on PyTorch tensors. TorchSim allows for easy prototyping and training of new models through automatic differentiation, and it supports multiple systems in parallel, leveraging the full potential of modern hardware. It addresses the challenge of combining traditional molecular dynamics methods with modern machine learning approaches, bridging the gap between physics-based simulations and data-driven modeling. The engine is particularly noteworthy for its ability to perform simulations with quantum accuracy at the speed of classical force fields, offering an intuitive interface for adding new MLIPs and integrating seamlessly with the broader computational chemistry ecosystem.