We present a deviational Monte Carlo method for solving the Boltzmann-Peierls equation with ab initio 3-phonon scattering, for temporally and spatially dependent thermal transport problems in arbitrary geometries. Phonon dispersion relations and transition rates for graphene are obtained from density functional theory calculations. The ab initio scattering operator is simulated by an energy-conserving stochastic algorithm embedded within a deviational, low-variance Monte Carlo formulation. The deviational formulation ensures that simulations are computationally feasible for arbitrarily small temperature differences, while the stochastic treatment of the scattering operator is both efficient and exhibits no timestep error. The proposed method, in which geometry and phonon-boundary scattering are explicitly treated, is extensively validated by comparison to analytical results, previous numerical solutions and experiments. It is subsequently used to generate solutions for heat transport in graphene ribbons of various geometries and evaluate the validity of some common approximations found in the literature. Our results show that modeling transport in long ribbons of finite width using the homogeneous Boltzmann equation and approximating phonon-boundary scattering using an additional homogeneous scattering rate introduces an error on the order of 10% at room temperature, with the maximum deviation reaching 30% in the middle of the transition regime.