Abstract: This letter proposes a structure-aware automatic differentiation method to accelerate the solution of alternating current optimal power flow (ACOPF) with nonlinear programming (NLP) solvers.