Meta is laying off about 10% of its global workforce amid a dramatic ramp up in spending on AI infrastructure.