The valley degree of freedom and the possibility of spin-valley coupling of solid materials have attracted growing interest, and the relaxation dynamics of spin- and valley-polarized states has become an important focus of recent studies. In spin-orbit-coupled inversion-asymmetric two-dimensional materials, such as MoS2, it has been found that the spin randomization is characteristically faster than the time scales for inter- and intra-valley scatterings. In this talk, I present our recent study of the ultrafast non-collinear spin dynamics of the electron in a valley of monolayer MoS2 by using real-time propagation time-dependent density functional theory. We found that the spin precession is sharply selectively coupled only with the particular optical phonon that lifts the in-plane mirror symmetry. We suggest that the observed spin randomization can be attributed to this spin-phonon interaction. Further, our results imply that flipping of spins in a spin-orbit-coupled system can be achieved by the control over phonons. In a later part of the talk, I would also describe the feature of the computational package we have developed and have used for the spin-phonon dynamics, which is based on the plane-wave basis set and various types of pseudopotentials.