The owner of Facebook, WhatsApp and Instagram is spending billions on new datacentres for artificial intelligence.