The impact of a large density gradient on edge-localized modes (ELMs) is studied linearly and nonlinearly by employing both two-fluid and gyro-fluid simulations. In two-fluid simulations, the ion diamagnetic stabilization on high-n modes disappears when the large density gradient is taken into account. But gyro-fluid simulations show that the finite Larmor radius (FLR) effect can effectively stabilize high-n modes, so the ion diamagnetic effect alone is not sufficient to represent the FLR stabilizing effect. We further demonstrate that additional gyroviscous terms must be kept in the two-fluid model to recover the linear results from the gyro-fluid model. Nonlinear simulations show that the density variation significantly weakens the E × B shearing at the top of the pedestal and thus leads to more energy loss during ELMs. The turbulence spectrum after an ELM crash is measured and has the relation of .