They refer to different things, although because of the way they are defined, they have the same numerical value. Thus one molecule of water has a mass of (in round figures) 18 amu, that is 18/12 times the mass of a 12C atom. One mole of water has a mass of 18 g. Hence the different units.