  We present a hierarchical galaxy formation model which can account for the
number counts of sources detected through their emission at sub-millimetre
wavelengths. The first stage in our approach is an ab initio calculation of the
star formation histories for a representative sample of galaxies, which is
carried out using the semi-analytical galaxy formation model GALFORM. These
star formation histories are then input into the spectro-photometric code
GRASIL, to produce a spectral energy distribution for each galaxy. Dust
extinction and emission are treated self consistently in our model, without
having to resort to ad-hoc assumptions about the amount of attenuation by dust
or the temperature at which the dust radiates. We argue that it is necessary to
modify the form of the stellar initial mass function in starbursts in order to
match the observed number of sub-mm sources, if we are to retain the previous
good matches enjoyed between observations and model predictions in the local
universe. We also list some other observational tests that have been passed by
our model.
