A light aircraft carburettor is a dumb object and doesn't really know anything, unlike modern electronic fuel injection systems that have a computer driven feedback loop.
It doesn't actually care whether it measures by mass or volume. The amount of fuel drawn into the manifold depends on the pressure drop across the venturi and is set for sea level ops by fitting an appropriately sized set of metering jets, emulsion tubes or whatever, depending on the manufacturer's whim.
The pilot provides the feedback loop with a carb and can (should) adjust it for altitude in flight by use of the manual mixture control.