  The abundance of magnesium in the interstellar medium is a powerful probe of
star formation processes over cosmological timescales. Magnesium has three
stable isotopes, 24Mg, 25Mg, 26Mg, which can be produced both in massive and
intermediate-mass (IM) stars with masses between 2 and 8 M_\odot. In this work,
we use constraints on the cosmic star formation rate density (SFRD) and explore
the role and mass range of intermediate mass stars using the observed isotopic
ratios. We compare several models of stellar nucleosynthesis with
metallicity-dependent yields and also consider the effect of rotation on the
yields massive stars and its consequences on the evolution of the Mg isotopes.
We use a cosmic evolution model updated with new observational SFRD data and
new reionization constraints coming from 2018 Planck collaboration
determinations. We find that the main contribution of 24Mg comes from massive
stars whereas 25Mg and 26Mg come from intermediate mass stars. To fit the
observational data on magnesium isotopic ratios, an additional intermediate
mass SFRD component is preferred. Moreover, the agreement between model and
data is further improved when the range of IM masses is narrowed towards higher
masses (5-8 M_\odot). While some rotation also improves the fit to data, we can
exclude the case where all stars have high rotational velocities due to an
over-production of 26Mg.
